@@ -1,5 +1,114 @@
Revision history for Dist-Zilla
+2.100960 2010-04-06 17:00:26 America/New_York
+ added @Basic, more suitable for basic use than @Classic
+ delegate logging to the Dist::Zilla::App object
+ the controller attribute is now called "chrome"; this should last
+ replace File::chdir with File::pushd (David Golden)
+
+2.100922 2010-04-02 18:53:55 America/New_York
+ BuildRunner and TestRunner routines now must die, not return errors
+
+ added TestRelease plugin (from Christopher J. Madsen)
+ refactored run_tests_in out of the test method
+
+2.100921 2010-04-02 16:04:57 America/New_York
+ add the missing ->ensure_built method
+
+2.100920 2010-04-02 10:45:45 America/New_York
+ BeforeArchive plugins introduced (thanks, Graham Barr)
+ PkgVersion now puts version declaration in a BEGIN block
+ fix required version of Config::MVP
+ include recommendations in distmeta
+
+2.100880 2010-03-29 10:00:20 America/New_York
+ first non-dev release of version 2
+
+2.100870 2010-03-28 17:07:24 America/New_York
+
+2.100862 2010-03-27 13:32:01 America/New_York
+
+2.100861 2010-03-27 13:17:23 America/New_York
+ INCOMPATIBLE CHANGES:
+
+ the AllFiles plugin is now known as GatherDir
+
+ the InstallDirs plugin has been replaced by ExecDir and ShareDir
+
+ the PodTests plugin has been replaced by PodCoverageTests and
+ PodSyntaxTests
+
+ the FixedPrereq role is replaced with PrereqSource
+
+ OTHER CHANGES:
+
+ numerous improvements to testing libraries
+ ...and numerous actual tests!
+
+ added include_dotfiles option to GatherDir
+ allow relative root directory for GatherDir
+
+ AutoPrereq is now distributed with Dist::Zilla
+
+ AutoPrereq will make requirements only found in ./t "build_requires"
+
+ ConfirmRelease plugin added and made part of @Classic (dagolden)
+
+ MakeMaker-produced Makefile.PL will produce warnings less often
+
+ MakeMaker-produced Makefile.PL will require v6.31 for INSTALL_BASE
+
+ Prereq plugin can target config_requires, build_requires, etc
+
+ dzil takes -v arg to enable debugging globally or per-plugin
+
+ PkgVersion now adds a fully-qualified $VERSION variables, not 'our'
+
+ PruneCruft prunes MYMETA.yml
+
+ add 'dzil nop' command to initialize zilla object and exit
+
+1.100711 2010-03-12 12:51:55 America/New_York
+ remove bogus attempt to load obsolete DZ::Logger::Global
+
+1.100710 2010-03-12 09:58:10 America/New_York
+ huge update to logging system; uses Log::Dispatchouli::Proxy
+
+ UploadToCPAN, FakeRelease now log via the standard logger
+ App::Cmd layer'Zilla is shared between commands
+
+ bump up some prereqs to avoid bugs fixed upstream
+
+ HIGHLY EXPERIMENTAL: first pass at testing systems
+
+1.100660 2010-03-07 07:56:30 America/New_York
+ Global logger handles log_fatal correctly
+
+1.100651 2010-03-06 23:18:54 America/New_York
+ improve how plugin and pluginbundle names are generated and reported
+ improve logging to make it clear what is logging what
+ add a -v switch to dzil to allow "verbose" logging
+
+1.100650 2010-03-06 11:46:23 America/New_York
+ add some missing prereqs
+ now configured with @RJBS rather than custom set of plugins
+
+1.100630 2010-03-03 22:23:21 America/New_York
+ the log method now uses a pluggable logger, defaulting to
+ Log::Dispatchouli
+ plugins now log with a useful prefix to indicate what is logging
+
+ prerequisites are now managed by Dist::Zilla::Prereq
+ complex prereqs (a la Version::Requirement) are possible
+
+1.100600 2010-03-01 08:19:06 America/New_York
+ the File role provides a mode attribute; files are chmodded on write
+ the mode attribute may not be world-writeable
+ files gathered by AllFiles will have their on-disk mode &= 0755
+
+1.100520 2010-02-21 15:53:39 America/New_York
+ MakeMaker plugin correctly requires the right version of perl again
+
1.100160 2010-01-16 15:37:29 America/New_York
require File::Install::ShareDir if needed for Makefile.PL share
@@ -6,6 +6,19 @@ META.yml
Makefile.PL
README
bin/dzil
+corpus/AutoPrereq/bin/foobar
+corpus/AutoPrereq/dist.ini
+corpus/AutoPrereq/lib/DZPA/Empty.pm
+corpus/AutoPrereq/lib/DZPA/Main.pm
+corpus/DZ1/dist.ini
+corpus/DZ1/lib/DZ1.pm
+corpus/DZ2/dist.pl
+corpus/DZ2/lib/DZ1.pm
+corpus/DZT/lib/DZT/Sample.pm
+corpus/DZT/t/basic.t
+corpus/README
+corpus/extra/subdir/index.html
+corpus/extra/vader.txt
dist.ini
inc/Dist/Zilla/Plugin/VersionBootstrap.pm
lib/Dist/Zilla.pm
@@ -15,26 +28,33 @@ lib/Dist/Zilla/App/Command/build.pm
lib/Dist/Zilla/App/Command/clean.pm
lib/Dist/Zilla/App/Command/install.pm
lib/Dist/Zilla/App/Command/new.pm
+lib/Dist/Zilla/App/Command/nop.pm
lib/Dist/Zilla/App/Command/release.pm
lib/Dist/Zilla/App/Command/run.pm
lib/Dist/Zilla/App/Command/smoke.pm
lib/Dist/Zilla/App/Command/test.pm
+lib/Dist/Zilla/App/Tester.pm
lib/Dist/Zilla/Config.pm
lib/Dist/Zilla/Config/Finder.pm
lib/Dist/Zilla/Config/Perl.pm
+lib/Dist/Zilla/File/FromCode.pm
lib/Dist/Zilla/File/InMemory.pm
lib/Dist/Zilla/File/OnDisk.pm
-lib/Dist/Zilla/Plugin/AllFiles.pm
+lib/Dist/Zilla/Plugin/AutoPrereq.pm
lib/Dist/Zilla/Plugin/AutoVersion.pm
lib/Dist/Zilla/Plugin/BumpVersion.pm
+lib/Dist/Zilla/Plugin/ConfirmRelease.pm
+lib/Dist/Zilla/Plugin/ExecDir.pm
lib/Dist/Zilla/Plugin/ExtraTests.pm
lib/Dist/Zilla/Plugin/FakeRelease.pm
+lib/Dist/Zilla/Plugin/FinderCode.pm
+lib/Dist/Zilla/Plugin/GatherDir.pm
lib/Dist/Zilla/Plugin/InlineFiles.pm
-lib/Dist/Zilla/Plugin/InstallDirs.pm
lib/Dist/Zilla/Plugin/License.pm
lib/Dist/Zilla/Plugin/MakeMaker.pm
lib/Dist/Zilla/Plugin/Manifest.pm
lib/Dist/Zilla/Plugin/ManifestSkip.pm
+lib/Dist/Zilla/Plugin/MetaConfig.pm
lib/Dist/Zilla/Plugin/MetaJSON.pm
lib/Dist/Zilla/Plugin/MetaResources.pm
lib/Dist/Zilla/Plugin/MetaTests.pm
@@ -42,47 +62,84 @@ lib/Dist/Zilla/Plugin/MetaYAML.pm
lib/Dist/Zilla/Plugin/ModuleBuild.pm
lib/Dist/Zilla/Plugin/NextRelease.pm
lib/Dist/Zilla/Plugin/PkgVersion.pm
-lib/Dist/Zilla/Plugin/PodTests.pm
+lib/Dist/Zilla/Plugin/PodCoverageTests.pm
+lib/Dist/Zilla/Plugin/PodSyntaxTests.pm
lib/Dist/Zilla/Plugin/PodVersion.pm
lib/Dist/Zilla/Plugin/Prereq.pm
lib/Dist/Zilla/Plugin/PruneCruft.pm
lib/Dist/Zilla/Plugin/PruneFiles.pm
lib/Dist/Zilla/Plugin/Readme.pm
+lib/Dist/Zilla/Plugin/ShareDir.pm
+lib/Dist/Zilla/Plugin/TestRelease.pm
lib/Dist/Zilla/Plugin/UploadToCPAN.pm
+lib/Dist/Zilla/PluginBundle/Basic.pm
lib/Dist/Zilla/PluginBundle/Classic.pm
+lib/Dist/Zilla/PluginBundle/FakeClassic.pm
lib/Dist/Zilla/PluginBundle/Filter.pm
+lib/Dist/Zilla/Prereqs.pm
lib/Dist/Zilla/Role/AfterBuild.pm
lib/Dist/Zilla/Role/AfterRelease.pm
+lib/Dist/Zilla/Role/BeforeArchive.pm
lib/Dist/Zilla/Role/BeforeBuild.pm
lib/Dist/Zilla/Role/BeforeRelease.pm
lib/Dist/Zilla/Role/BuildRunner.pm
+lib/Dist/Zilla/Role/ConfigDumper.pm
+lib/Dist/Zilla/Role/ExecFiles.pm
lib/Dist/Zilla/Role/File.pm
lib/Dist/Zilla/Role/FileFinder.pm
+lib/Dist/Zilla/Role/FileFinderUser.pm
lib/Dist/Zilla/Role/FileGatherer.pm
lib/Dist/Zilla/Role/FileInjector.pm
lib/Dist/Zilla/Role/FileMunger.pm
lib/Dist/Zilla/Role/FilePruner.pm
-lib/Dist/Zilla/Role/FixedPrereqs.pm
lib/Dist/Zilla/Role/InstallTool.pm
lib/Dist/Zilla/Role/MetaProvider.pm
lib/Dist/Zilla/Role/Plugin.pm
lib/Dist/Zilla/Role/PluginBundle.pm
+lib/Dist/Zilla/Role/PrereqSource.pm
lib/Dist/Zilla/Role/Releaser.pm
+lib/Dist/Zilla/Role/ShareDir.pm
lib/Dist/Zilla/Role/TestRunner.pm
lib/Dist/Zilla/Role/TextTemplate.pm
lib/Dist/Zilla/Role/VersionProvider.pm
+lib/Dist/Zilla/Tester.pm
lib/Dist/Zilla/Tutorial.pm
lib/Dist/Zilla/Types.pm
lib/Dist/Zilla/Util.pm
lib/Dist/Zilla/Util/MVPAssembler.pm
misc/dzil-bash_completion
misc/dzil_bootstrap
-t/basic.t
-t/dz1.t
-t/dz2.t
-t/eg/DZ1/dist.ini
-t/eg/DZ1/lib/DZ1.pm
-t/eg/DZ2/dist.pl
-t/eg/DZ2/lib/DZ1.pm
-t/lib/Dist/Zilla/Plugin/CreditTaker.pm
-t/lib/Dist/Zilla/Plugin/FailTest.pm
\ No newline at end of file
+t/compile.t
+t/lib/Test/DZil.pm
+t/plugins/autoprereq.t
+t/plugins/autoversion.t
+t/plugins/confirmrelease.t
+t/plugins/distmeta.t
+t/plugins/extratests.t
+t/plugins/fakerelease.t
+t/plugins/filter-b.t
+t/plugins/gatherdir.t
+t/plugins/installdirs.t
+t/plugins/license.t
+t/plugins/makemaker.t
+t/plugins/misctests.t
+t/plugins/modulebuild.t
+t/plugins/nextrelease.t
+t/plugins/pkgversion.t
+t/plugins/podversion.t
+t/plugins/prunes.t
+t/plugins/readme.t
+t/release-pod-syntax.t
+t/tester-demo.t
+todo/CHECKLIST-testing.txt
+todo/command-classes.txt
+todo/command-plugins.txt
+todo/config-arg-prefix.txt
+todo/delay-core-attrs.txt
+todo/external-core-attr.txt
+todo/new-dist-events.txt
+todo/prereq-command.txt
+todo/register-on-fly.txt
+todo/test-upstream.txt
+todo/version-from-prev.txt
+todo/xs-improvement.txt
\ No newline at end of file
@@ -1,55 +1,303 @@
{
- "resources" : {
- "repository" : "http://github.com/rjbs/dist-zilla",
- "homepage" : "http://search.cpan.org/dist/Dist-Zilla/",
- "MailingList" : "http://www.listbox.com/subscribe/?list_id=139292"
- },
- "generated_by" : "Dist::Zilla version 1.100160",
- "meta-spec" : {
- "version" : 1.4,
- "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
- },
- "version" : "1.100160",
- "name" : "Dist-Zilla",
+ "abstract" : "distribution builder; installer not included!",
"author" : [
"Ricardo SIGNES <rjbs@cpan.org>"
],
+ "build_requires" : {
+ "Test::More" : "0.90",
+ "Try::Tiny" : "0"
+ },
+ "configure_requires" : {
+ "ExtUtils::MakeMaker" : "6.31"
+ },
+ "generated_by" : "Dist::Zilla version 2.100960",
"license" : "perl",
+ "meta-spec" : {
+ "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html",
+ "version" : 1.4
+ },
+ "name" : "Dist-Zilla",
+ "no_index" : {
+ "directory" : [
+ "corpus"
+ ]
+ },
+ "recommends" : {},
"requires" : {
- "DateTime" : "0.44",
- "PPI" : "0",
+ "App::Cmd::Setup" : "0.307",
+ "App::Cmd::Tester" : "0.306",
+ "Archive::Tar" : "0",
+ "CPAN::Uploader" : "0.100660",
+ "Carp" : "0",
"Config::INI::MVP::Reader" : "0.024",
- "App::Cmd" : "0.299",
- "Pod::Eventual" : "0.091480",
- "String::RewritePrefix" : "0.002",
+ "Config::MVP" : "0.100780",
+ "Config::MVP::Assembler" : "0",
+ "Config::MVP::Assembler::WithBundles" : "0",
+ "Config::MVP::Reader" : "0",
+ "Config::MVP::Reader::Findable" : "0",
+ "Config::MVP::Reader::Finder" : "0",
+ "Data::Dumper" : "0",
"Data::Section" : "0.004",
- "File::chdir" : "0",
- "Config::MVP" : "0.092990",
- "Perl::Version" : "0",
- "autobox" : "2.53",
- "Software::License" : "0",
- "Archive::Tar" : "0",
- "List::MoreUtils" : "0",
- "Moose" : "0.92",
+ "DateTime" : "0.44",
+ "ExtUtils::MakeMaker" : "0",
"ExtUtils::Manifest" : "1.54",
- "String::Flogger" : "1",
+ "File::Copy::Recursive" : "0",
"File::Find::Rule" : "0",
- "Mixin::ExtraFields::Param" : "0",
- "namespace::autoclean" : "0",
- "YAML::Tiny" : "0",
"File::HomeDir" : "0",
- "ExtUtils::MakeMaker" : "0",
- "CPAN::Uploader" : "0",
+ "File::Path" : "0",
+ "File::ShareDir::Install" : "0.03",
+ "File::Spec" : "0",
+ "File::Temp" : "0",
+ "File::pushd" : "0",
+ "Hash::Merge::Simple" : "0",
+ "JSON" : "2",
+ "List::MoreUtils" : "0",
+ "List::Util" : "0",
+ "Log::Dispatchouli" : "1.100712",
+ "Mixin::ExtraFields" : "0",
+ "Moose" : "0.92",
"Moose::Autobox" : "0.09",
- "Test::More" : "0",
+ "Moose::Role" : "0",
+ "Moose::Util::TypeConstraints" : "0",
+ "MooseX::Role::Parameterized" : "0",
+ "MooseX::Types" : "0",
+ "MooseX::Types::Moose" : "0",
"MooseX::Types::Path::Class" : "0",
- "Hash::Merge::Simple" : "0",
- "File::Temp" : "0",
+ "PPI" : "0",
+ "Params::Util" : "0",
"Path::Class" : "0",
- "String::Formatter" : "0",
- "File::ShareDir::Install" : "0.03",
- "Text::Template" : "0"
+ "Perl::PrereqScanner" : "0.100830",
+ "Perl::Version" : "0",
+ "Pod::Eventual" : "0.091480",
+ "Scalar::Util" : "0",
+ "Software::License" : "0",
+ "Software::LicenseUtils" : "0",
+ "String::Formatter" : "0.100680",
+ "String::RewritePrefix" : "0.002",
+ "Sub::Exporter" : "0",
+ "Sub::Exporter::Util" : "0",
+ "Text::Template" : "0",
+ "Version::Requirements" : "0.100630",
+ "YAML::Tiny" : "0",
+ "autobox" : "2.53",
+ "autodie" : "0",
+ "namespace::autoclean" : "0",
+ "perl" : "v5.8.5",
+ "version" : "0"
+ },
+ "resources" : {
+ "MailingList" : "http://www.listbox.com/subscribe/?list_id=139292",
+ "homepage" : "http://dzil.org/",
+ "repository" : "http://github.com/rjbs/dist-zilla"
},
- "abstract" : "distribution builder; installer not included!"
+ "version" : "2.100960",
+ "x_Dist_Zilla" : {
+ "plugins" : [
+ {
+ "class" : "Dist::Zilla::Plugin::TestRelease",
+ "name" : "TestRelease",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::TestRelease",
+ "name" : "@RJBS/TestRelease",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::GatherDir",
+ "name" : "@RJBS/@Classic/GatherDir",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PruneCruft",
+ "name" : "@RJBS/@Classic/PruneCruft",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ManifestSkip",
+ "name" : "@RJBS/@Classic/ManifestSkip",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MetaYAML",
+ "name" : "@RJBS/@Classic/MetaYAML",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::License",
+ "name" : "@RJBS/@Classic/License",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Readme",
+ "name" : "@RJBS/@Classic/Readme",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PkgVersion",
+ "name" : "@RJBS/@Classic/PkgVersion",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
+ "name" : "@RJBS/@Classic/PodSyntaxTests",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ExtraTests",
+ "name" : "@RJBS/@Classic/ExtraTests",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ExecDir",
+ "name" : "@RJBS/@Classic/ExecDir",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ShareDir",
+ "name" : "@RJBS/@Classic/ShareDir",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MakeMaker",
+ "name" : "@RJBS/@Classic/MakeMaker",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Manifest",
+ "name" : "@RJBS/@Classic/Manifest",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ConfirmRelease",
+ "name" : "@RJBS/@Classic/ConfirmRelease",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::UploadToCPAN",
+ "name" : "@RJBS/@Classic/UploadToCPAN",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::AutoPrereq",
+ "name" : "@RJBS/AutoPrereq",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::AutoVersion",
+ "name" : "@RJBS/AutoVersion",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MetaConfig",
+ "name" : "@RJBS/MetaConfig",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MetaJSON",
+ "name" : "@RJBS/MetaJSON",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::NextRelease",
+ "name" : "@RJBS/NextRelease",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PodWeaver",
+ "name" : "@RJBS/PodWeaver",
+ "version" : "3.100710"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Repository",
+ "name" : "@RJBS/Repository",
+ "version" : "0.11"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Check",
+ "name" : "@RJBS/@Git/Check",
+ "version" : "1.100760"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Commit",
+ "name" : "@RJBS/@Git/Commit",
+ "version" : "1.100760"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Tag",
+ "name" : "@RJBS/@Git/Tag",
+ "version" : "1.100760"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Push",
+ "name" : "@RJBS/@Git/Push",
+ "version" : "1.100760"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MetaNoIndex",
+ "name" : "MetaNoIndex",
+ "version" : "0.0300"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::MetaResources",
+ "name" : "MetaResources",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Prereq",
+ "config" : {
+ "Dist::Zilla::Plugin::Prereq" : {
+ "phase" : "build",
+ "type" : "requires"
+ }
+ },
+ "name" : "TestRequires",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Prereq",
+ "config" : {
+ "Dist::Zilla::Plugin::Prereq" : {
+ "phase" : "runtime",
+ "type" : "requires"
+ }
+ },
+ "name" : "Prereq",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "inc::Dist::Zilla::Plugin::VersionBootstrap",
+ "name" : "VersionBootstrap",
+ "version" : "2.100960"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":InstallModules",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":TestFiles",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":ExecFiles",
+ "version" : "2.100950"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":ShareFiles",
+ "version" : "2.100950"
+ }
+ ],
+ "zilla" : {
+ "class" : "Dist::Zilla",
+ "config" : {
+ "is_trial" : 0
+ },
+ "version" : "2.100960"
+ }
+ }
}
@@ -2,48 +2,247 @@
abstract: 'distribution builder; installer not included!'
author:
- 'Ricardo SIGNES <rjbs@cpan.org>'
-generated_by: 'Dist::Zilla version 1.100160'
+build_requires:
+ Test::More: 0.90
+ Try::Tiny: 0
+configure_requires:
+ ExtUtils::MakeMaker: 6.31
+generated_by: 'Dist::Zilla version 2.100960'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Dist-Zilla
+no_index:
+ directory:
+ - corpus
+recommends: {}
requires:
- App::Cmd: 0.299
+ App::Cmd::Setup: 0.307
+ App::Cmd::Tester: 0.306
Archive::Tar: 0
- CPAN::Uploader: 0
+ CPAN::Uploader: 0.100660
+ Carp: 0
Config::INI::MVP::Reader: 0.024
- Config::MVP: 0.092990
+ Config::MVP: 0.100780
+ Config::MVP::Assembler: 0
+ Config::MVP::Assembler::WithBundles: 0
+ Config::MVP::Reader: 0
+ Config::MVP::Reader::Findable: 0
+ Config::MVP::Reader::Finder: 0
+ Data::Dumper: 0
Data::Section: 0.004
DateTime: 0.44
ExtUtils::MakeMaker: 0
ExtUtils::Manifest: 1.54
+ File::Copy::Recursive: 0
File::Find::Rule: 0
File::HomeDir: 0
+ File::Path: 0
File::ShareDir::Install: 0.03
+ File::Spec: 0
File::Temp: 0
- File::chdir: 0
+ File::pushd: 0
Hash::Merge::Simple: 0
+ JSON: 2
List::MoreUtils: 0
- Mixin::ExtraFields::Param: 0
+ List::Util: 0
+ Log::Dispatchouli: 1.100712
+ Mixin::ExtraFields: 0
Moose: 0.92
Moose::Autobox: 0.09
+ Moose::Role: 0
+ Moose::Util::TypeConstraints: 0
+ MooseX::Role::Parameterized: 0
+ MooseX::Types: 0
+ MooseX::Types::Moose: 0
MooseX::Types::Path::Class: 0
PPI: 0
+ Params::Util: 0
Path::Class: 0
+ Perl::PrereqScanner: 0.100830
Perl::Version: 0
Pod::Eventual: 0.091480
+ Scalar::Util: 0
Software::License: 0
- String::Flogger: 1
- String::Formatter: 0
+ Software::LicenseUtils: 0
+ String::Formatter: 0.100680
String::RewritePrefix: 0.002
- Test::More: 0
+ Sub::Exporter: 0
+ Sub::Exporter::Util: 0
Text::Template: 0
+ Version::Requirements: 0.100630
YAML::Tiny: 0
autobox: 2.53
+ autodie: 0
namespace::autoclean: 0
+ perl: v5.8.5
+ version: 0
resources:
MailingList: http://www.listbox.com/subscribe/?list_id=139292
- homepage: http://search.cpan.org/dist/Dist-Zilla/
+ homepage: http://dzil.org/
repository: http://github.com/rjbs/dist-zilla
-version: 1.100160
+version: 2.100960
+x_Dist_Zilla:
+ plugins:
+ -
+ class: Dist::Zilla::Plugin::TestRelease
+ name: TestRelease
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::TestRelease
+ name: '@RJBS/TestRelease'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::GatherDir
+ name: '@RJBS/@Classic/GatherDir'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::PruneCruft
+ name: '@RJBS/@Classic/PruneCruft'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::ManifestSkip
+ name: '@RJBS/@Classic/ManifestSkip'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::MetaYAML
+ name: '@RJBS/@Classic/MetaYAML'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::License
+ name: '@RJBS/@Classic/License'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::Readme
+ name: '@RJBS/@Classic/Readme'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::PkgVersion
+ name: '@RJBS/@Classic/PkgVersion'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::PodSyntaxTests
+ name: '@RJBS/@Classic/PodSyntaxTests'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::ExtraTests
+ name: '@RJBS/@Classic/ExtraTests'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::ExecDir
+ name: '@RJBS/@Classic/ExecDir'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::ShareDir
+ name: '@RJBS/@Classic/ShareDir'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::MakeMaker
+ name: '@RJBS/@Classic/MakeMaker'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::Manifest
+ name: '@RJBS/@Classic/Manifest'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::ConfirmRelease
+ name: '@RJBS/@Classic/ConfirmRelease'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::UploadToCPAN
+ name: '@RJBS/@Classic/UploadToCPAN'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::AutoPrereq
+ name: '@RJBS/AutoPrereq'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::AutoVersion
+ name: '@RJBS/AutoVersion'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::MetaConfig
+ name: '@RJBS/MetaConfig'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::MetaJSON
+ name: '@RJBS/MetaJSON'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::NextRelease
+ name: '@RJBS/NextRelease'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::PodWeaver
+ name: '@RJBS/PodWeaver'
+ version: 3.100710
+ -
+ class: Dist::Zilla::Plugin::Repository
+ name: '@RJBS/Repository'
+ version: 0.11
+ -
+ class: Dist::Zilla::Plugin::Git::Check
+ name: '@RJBS/@Git/Check'
+ version: 1.100760
+ -
+ class: Dist::Zilla::Plugin::Git::Commit
+ name: '@RJBS/@Git/Commit'
+ version: 1.100760
+ -
+ class: Dist::Zilla::Plugin::Git::Tag
+ name: '@RJBS/@Git/Tag'
+ version: 1.100760
+ -
+ class: Dist::Zilla::Plugin::Git::Push
+ name: '@RJBS/@Git/Push'
+ version: 1.100760
+ -
+ class: Dist::Zilla::Plugin::MetaNoIndex
+ name: MetaNoIndex
+ version: 0.0300
+ -
+ class: Dist::Zilla::Plugin::MetaResources
+ name: MetaResources
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::Prereq
+ config:
+ Dist::Zilla::Plugin::Prereq:
+ phase: build
+ type: requires
+ name: TestRequires
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::Prereq
+ config:
+ Dist::Zilla::Plugin::Prereq:
+ phase: runtime
+ type: requires
+ name: Prereq
+ version: 2.100950
+ -
+ class: inc::Dist::Zilla::Plugin::VersionBootstrap
+ name: VersionBootstrap
+ version: 2.100960
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':InstallModules'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':TestFiles'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':ExecFiles'
+ version: 2.100950
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':ShareFiles'
+ version: 2.100950
+ zilla:
+ class: Dist::Zilla
+ config:
+ is_trial: 0
+ version: 2.100960
@@ -2,65 +2,101 @@
use strict;
use warnings;
+ BEGIN { require v5.8.5; }
-
-use ExtUtils::MakeMaker 6.11;
+use ExtUtils::MakeMaker 6.31;
my %WriteMakefileArgs = (
'test' => {
- 'TESTS' => 't/*.t'
+ 'TESTS' => 't/*.t t/plugins/*.t'
},
'NAME' => 'Dist::Zilla',
'DISTNAME' => 'Dist-Zilla',
+ 'CONFIGURE_REQUIRES' => {
+ 'ExtUtils::MakeMaker' => '6.31'
+ },
'AUTHOR' => 'Ricardo SIGNES <rjbs@cpan.org>',
+ 'BUILD_REQUIRES' => {
+ 'Try::Tiny' => '0',
+ 'Test::More' => '0.90'
+ },
'ABSTRACT' => 'distribution builder; installer not included!',
'EXE_FILES' => [
'bin/dzil'
],
- 'VERSION' => '1.100160',
- 'LICENSE' => 'perl',
+ 'VERSION' => '2.100960',
'PREREQ_PM' => {
- 'PPI' => '0',
'DateTime' => '0.44',
- 'Config::INI::MVP::Reader' => '0.024',
+ 'PPI' => '0',
+ 'Perl::PrereqScanner' => '0.100830',
'Pod::Eventual' => '0.091480',
- 'App::Cmd' => '0.299',
- 'Data::Section' => '0.004',
- 'String::RewritePrefix' => '0.002',
- 'File::chdir' => '0',
- 'Config::MVP' => '0.092990',
+ 'Sub::Exporter' => '0',
+ 'List::Util' => '0',
+ 'Config::MVP' => '0.100780',
+ 'App::Cmd::Setup' => '0.307',
+ 'autodie' => '0',
+ 'Mixin::ExtraFields' => '0',
+ 'Config::MVP::Assembler::WithBundles' => '0',
'autobox' => '2.53',
- 'Perl::Version' => '0',
'Software::License' => '0',
+ 'File::Path' => '0',
'Archive::Tar' => '0',
'List::MoreUtils' => '0',
- 'String::Flogger' => '1',
'ExtUtils::Manifest' => '1.54',
- 'Moose' => '0.92',
- 'Mixin::ExtraFields::Param' => '0',
- 'File::Find::Rule' => '0',
- 'namespace::autoclean' => '0',
+ 'Moose::Role' => '0',
'File::HomeDir' => '0',
- 'YAML::Tiny' => '0',
+ 'File::pushd' => '0',
+ 'Data::Dumper' => '0',
'ExtUtils::MakeMaker' => '0',
- 'CPAN::Uploader' => '0',
+ 'Config::MVP::Reader' => '0',
'Moose::Autobox' => '0.09',
- 'Test::More' => '0',
'MooseX::Types::Path::Class' => '0',
'Hash::Merge::Simple' => '0',
+ 'MooseX::Types' => '0',
'File::Temp' => '0',
+ 'Config::MVP::Reader::Finder' => '0',
+ 'File::Copy::Recursive' => '0',
'Path::Class' => '0',
- 'String::Formatter' => '0',
- 'File::ShareDir::Install' => '0.03',
- 'Text::Template' => '0'
- }
+ 'Text::Template' => '0',
+ 'App::Cmd::Tester' => '0.306',
+ 'Config::MVP::Assembler' => '0',
+ 'Scalar::Util' => '0',
+ 'MooseX::Types::Moose' => '0',
+ 'Config::INI::MVP::Reader' => '0.024',
+ 'File::Spec' => '0',
+ 'String::RewritePrefix' => '0.002',
+ 'Data::Section' => '0.004',
+ 'Moose::Util::TypeConstraints' => '0',
+ 'Log::Dispatchouli' => '1.100712',
+ 'Params::Util' => '0',
+ 'Perl::Version' => '0',
+ 'Moose' => '0.92',
+ 'Software::LicenseUtils' => '0',
+ 'File::Find::Rule' => '0',
+ 'namespace::autoclean' => '0',
+ 'YAML::Tiny' => '0',
+ 'version' => '0',
+ 'CPAN::Uploader' => '0.100660',
+ 'Carp' => '0',
+ 'Sub::Exporter::Util' => '0',
+ 'Version::Requirements' => '0.100630',
+ 'Config::MVP::Reader::Findable' => '0',
+ 'MooseX::Role::Parameterized' => '0',
+ 'JSON' => '2',
+ 'String::Formatter' => '0.100680',
+ 'File::ShareDir::Install' => '0.03'
+ },
+ 'LICENSE' => 'perl'
);
-delete $WriteMakefileArgs{LICENSE}
- unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
+delete $WriteMakefileArgs{BUILD_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.56) };
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
@@ -1,7 +1,7 @@
-This archive contains the distribution Dist-Zilla, version
-1.100160:
+This archive contains the distribution Dist-Zilla,
+version 2.100960:
distribution builder; installer not included!
@@ -10,3 +10,4 @@ This software is copyright (c) 2010 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
+
diff --git a/var/tmp/source/RJBS/Dist-Zilla-1.100160/Dist-Zilla-1.100160/bin/dzil b/var/tmp/source/RJBS/Dist-Zilla-2.100960/Dist-Zilla-2.100960/bin/dzil
old mode 100644
new mode 100755
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use lib 'mylib';
+
+# require in a script
+use DZPA::ScriptUse;
+
+# module shipped by dist
+use DZPA::Main;
+
+# DZPA::Skip should be trimmed
+require DZPA::Skip::Foo;
@@ -0,0 +1,12 @@
+name = Foo
+version = 1.23
+author = foobar
+license = Perl_5
+copyright_holder = foobar
+copyright_year = 2009
+
+[GatherDir]
+[ExecDir]
+[AutoPrereq]
+skip = ^DZPA::Skip
+[MetaYAML]
@@ -0,0 +1,7 @@
+package DZPA::Main;
+# ABSTRACT: dumb module to test DZPA
+
+# look, no prereq! this used to crash autoprereq
+
+1;
+__END__
@@ -0,0 +1,47 @@
+package DZPA::Main;
+# ABSTRACT: dumb module to test DZPA
+
+# perl minimum version
+use 5.008;
+
+# under DZPA::, but not shipped by the dist
+use DZPA::NotInDist;
+
+# minimum version + comment after the semicolon.
+use DZPA::MinVerComment 0.50; # comment
+
+# Moose features
+with 'DZPA::Role';
+extends 'DZPA::Base::Moose1', 'DZPA::Base::Moose2';
+
+# inheritance
+use base "DZPA::Base::base1";
+use base qw{ DZPA::Base::base2 DZPA::Base::base3 };
+use parent "DZPA::Base::parent1";
+use parent qw{ DZPA::Base::parent2 DZPA::Base::parent3 };
+
+# DZPA::Skip should be trimmed
+use DZPA::Skip::Blah;
+
+# require in a module
+require DZPA::ModRequire;
+
+# indented
+{
+ use DZPA::IndentedUse 0.13;
+ require DZPA::IndentedRequire 3.45;
+}
+
+use DZPA::IgnoreAPI
+ require => 1; # module pluggable has such an api
+print qw{
+ use !!
+};
+
+__END__
+=head1 FOO
+
+this pod should not be taken in to account, with:
+use fake;
+require blah;
+with 'fubar';
@@ -0,0 +1,7 @@
+name = DZ1
+version = 0.001
+author = E. Xavier Ample <example@example.org>
+license = Perl_5
+copyright_holder = E. Xavier Ample
+
+[@Classic]
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+package DZ1;
+# ABSTRACT: this is a sample package for testing Dist::Zilla;
+
+sub main {
+ return 1;
+}
+
+1;
@@ -0,0 +1,8 @@
+name => 'DZ2',
+version => '0.001',
+author => 'E. Xavier Ample <example@example.org>',
+license => 'Perl_5',
+copyright_holder => 'E. Xavier Ample',
+[
+ '@Classic',
+]
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+package DZ1;
+# ABSTRACT: this is a sample package for testing Dist::Zilla;
+
+sub main {
+ return 1;
+}
+
+1;
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+package DZT::Sample;
+
+sub return_arrayref_of_values_passed {
+ my $invocant = shift;
+ return \@_;
+}
+
+1;
@@ -0,0 +1,13 @@
+use strict;
+use warnings;
+
+use Test::More 0.88;
+use DZT::Sample;
+
+is_deeply(
+ DZT::Sample->return_arrayref_of_values_passed(1, [ 2 ], { 3 => 4 }),
+ [ 1, [ 2 ], { 3 => 4 } ],
+ "we do what we say on the tin",
+);
+
+done_testing;
@@ -0,0 +1,6 @@
+
+This directory contains a set of distributions used by testing. Since the
+distributions contain *.t files, it's easier to put them outside of ./t so that
+recursive test harnesses do not try running their dists.
+
+
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ <h1>SUPPLIES</h1>
+ </body>
+</html>
@@ -0,0 +1,3 @@
+
+(breathing sounds)
+
@@ -3,68 +3,29 @@ author = Ricardo SIGNES <rjbs@cpan.org>
license = Perl_5
copyright_holder = Ricardo SIGNES
-[AutoVersion]
-[AllFiles]
-[PruneCruft]
+[TestRelease]
+
+[@RJBS]
+version = 2
+
+[MetaNoIndex]
+dir = corpus
-[MetaJSON]
-[MetaYAML]
[MetaResources]
-homepage = http://search.cpan.org/dist/Dist-Zilla/
+homepage = http://dzil.org/
repository = http://github.com/rjbs/dist-zilla
MailingList = http://www.listbox.com/subscribe/?list_id=139292
-[License]
-[Readme]
-
-[InstallDirs]
-
-[PkgVersion]
-[PodWeaver]
-
-[MakeMaker]
-
-[Manifest]
-
-[NextRelease]
-[UploadToCPAN]
+[Prereq / TestRequires]
+Test::More = 0.90
[Prereq]
-autobox = 2.53 ; @array->method support, portability
-App::Cmd = 0.299 ; commands use ->execute
-Archive::Tar = 0
-Config::MVP = 0.092990 ; Reader
-CPAN::Uploader = 0
-DateTime = 0.44 ; CLDR support; 'yy' format fixed
-Data::Section = 0.004 ; fixed header_re
-File::Temp = 0
-File::chdir = 0
-File::HomeDir = 0
-List::MoreUtils = 0
-Moose = 0.92 ; role composition bugfixes
-Moose::Autobox = 0.09 ; flattten
-Path::Class = 0
-Perl::Version = 0
-Pod::Eventual = 0.091480 ; better nonpod/blank events
-PPI = 0
-Software::License = 0
-String::Formatter = 0
-String::Flogger = 1
-Test::More = 0
-Text::Template = 0
-YAML::Tiny = 0
+perl = v5.8.5 ; how tempted am I to set this to v5.10? very!
+autobox = 2.53 ; @array->method support, portability
Config::INI::MVP::Reader = 0.024 ; Config::MVP::Reader plugin
-ExtUtils::MakeMaker = 0
-ExtUtils::Manifest = 1.54 ; public maniskip
-File::Find::Rule = 0
File::ShareDir::Install = 0.03 ; for EUMM
-Hash::Merge::Simple = 0
-Mixin::ExtraFields::Param = 0
-MooseX::Types::Path::Class = 0
-namespace::autoclean = 0
-String::RewritePrefix = 0.002 ; scalar context is better
-; We need this to bootstrap a version into Dist::Zilla while running, so that it
-; can inject its version number into "generated by" strings. -- rjbs
-[=inc::Dist::Zilla::Plugin::VersionBootstrap]
+; We need this to bootstrap a version into Dist::Zilla while running, so that
+; it can inject its version number into "generated by" strings. -- rjbs
+[=inc::Dist::Zilla::Plugin::VersionBootstrap / VersionBootstrap]
@@ -1,5 +1,4 @@
package inc::Dist::Zilla::Plugin::VersionBootstrap;
-our $VERSION = '1.100160';
# ABSTRACT: set Dist::Zilla::* $VERSION during Dist-Zilla dzilling
use Moose;
use Moose::Autobox;
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::build;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::build::VERSION = '2.100960';
+}
# ABSTRACT: build your dist
use Dist::Zilla::App -command;
@@ -10,15 +12,18 @@ sub abstract { 'build your dist' }
sub opt_spec {
- [ 'tgz!', 'build a tarball (default behavior)', { default => 1 } ]
+ [ 'trial' => 'build a trial release that PAUSE will not index' ],
+ [ 'tgz!' => 'build a tarball (default behavior)', { default => 1 } ]
}
sub execute {
my ($self, $opt, $arg) = @_;
- my $method = $opt->{tgz} ? 'build_archive' : 'build_in';
- $self->zilla->$method;
+ my $method = $opt->tgz ? 'build_archive' : 'build';
+ my $zilla = $self->zilla;
+ $zilla->is_trial(1) if $opt->trial;
+ $zilla->$method;
}
1;
@@ -32,27 +37,27 @@ Dist::Zilla::App::Command::build - build your dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
Builds your distribution and emits tar.gz files / directories.
- dzil build [--tgz|--notgz]
+ dzil build [ --tgz | --no-tgz ]
=head1 EXAMPLE
$ dzil build
$ dzil build --tgz
- $ dzil build --notgz
+ $ dzil build --no-tgz
=head1 OPTIONS
-=head2 --tgz | --notgz
+=head2 --tgz | --no-tgz
Builds a .tar.gz in your project directory after building the distribution.
---tgz behaviour is by default, use --notgz to disable building an archive.
+--tgz behaviour is by default, use --no-tgz to disable building an archive.
=head1 AUTHOR
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::clean;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::clean::VERSION = '2.100960';
+}
# ABSTRACT: clean up after build, test, or install
use Dist::Zilla::App -command;
@@ -13,19 +15,7 @@ sub abstract { 'clean up after build, test, or install' }
sub execute {
my ($self, $opt, $arg) = @_;
- require File::Path;
- for my $x (grep { -e } '.build', glob($self->zilla->name . '-*')) {
- $self->log("clean: removing $x");
- File::Path::rmtree($x);
- };
-
- # removing leftovers
- my @temps =
- File::Find::Rule
- ->file
- ->name( qr/~$/ )
- ->in('.');
- unlink @temps;
+ $self->zilla->clean;
}
1;
@@ -39,7 +29,7 @@ Dist::Zilla::App::Command::clean - clean up after build, test, or install
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::install;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::install::VERSION = '2.100960';
+}
# ABSTRACT: install your dist
use Dist::Zilla::App -command;
@@ -13,38 +15,12 @@ sub opt_spec {
}
-
sub execute {
my ($self, $opt, $arg) = @_;
- require File::chdir;
- require File::Temp;
- require Path::Class;
-
- my $build_root = Path::Class::dir('.build');
- $build_root->mkpath unless -d $build_root;
-
- my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
- $self->log("building distribution under $target for installation");
- $self->zilla->ensure_built_in($target);
-
- eval {
- ## no critic Punctuation
- local $File::chdir::CWD = $target;
- my @cmd = $opt->{install_command}
- ? $opt->{install_command}
- : ($^X => '-MCPAN' => '-einstall "."');
-
- system(@cmd) && die "error with '@cmd'\n";
- };
-
- if ($@) {
- $self->log($@);
- $self->log("left failed dist in place at $target");
- } else {
- $self->log("all's well; removing $target");
- $target->rmtree;
- }
+ $self->zilla->install({
+ ($opt->install_command ? (install_command => $opt->install_command) : ()),
+ });
}
1;
@@ -58,7 +34,7 @@ Dist::Zilla::App::Command::install - install your dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::new;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::new::VERSION = '2.100960';
+}
# ABSTRACT: start a new dist
use Dist::Zilla::App -command;
@@ -106,7 +108,7 @@ Dist::Zilla::App::Command::new - start a new dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+package Dist::Zilla::App::Command::nop;
+BEGIN {
+ $Dist::Zilla::App::Command::nop::VERSION = '2.100960';
+}
+# ABSTRACT: initialize dzil, then exit
+use Dist::Zilla::App -command;
+
+
+sub abstract { 'do nothing: initialize dzil, then exit' }
+
+sub opt_spec {
+}
+
+sub execute {
+ my ($self, $opt, $arg) = @_;
+
+ $self->zilla;
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::App::Command::nop - initialize dzil, then exit
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 SYNOPSIS
+
+This command does nothing. It initializes Dist::Zill, then exits. This is
+useful to see the logging output of plugin initialization.
+
+ dzil nop -v
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,15 +1,26 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::release;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::release::VERSION = '2.100960';
+}
# ABSTRACT: release your dist to the CPAN
use Dist::Zilla::App -command;
sub abstract { 'release your dist' }
+sub opt_spec {
+ [ 'trial' => 'build a trial release that PAUSE will not index' ],
+}
+
sub execute {
my ($self, $opt, $arg) = @_;
+
+ my $zilla = $self->zilla;
+
+ $zilla->is_trial(1) if $opt->trial;
+
$self->zilla->release;
}
@@ -24,7 +35,7 @@ Dist::Zilla::App::Command::release - release your dist to the CPAN
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -2,7 +2,9 @@ use strict;
use warnings;
package Dist::Zilla::App::Command::run;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::run::VERSION = '2.100960';
+}
# ABSTRACT: run stuff in a dir where your dist is built
use Dist::Zilla::App -command;
@@ -13,47 +15,7 @@ sub abstract { 'run stuff in a dir where your dist is built' }
sub execute {
my ($self, $opts, $args) = @_;
- # The sort below is a cheap hack to get ModuleBuild ahead of
- # ExtUtils::MakeMaker. -- rjbs, 2010-01-05
- Carp::croak("you can't release without any InstallTool plugins")
- unless my @builders =
- $self->zilla->plugins_with(-BuildRunner)->sort->reverse->flatten;
-
- require Config;
- require File::chdir;
- require File::Temp;
- require Path::Class;
-
- # dzil-build the dist
- my $build_root = Path::Class::dir('.build');
- $build_root->mkpath unless -d $build_root;
-
- my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
- my $abstarget = $target->absolute;
- $self->log("building test distribution under $target");
-
- $self->zilla->ensure_built_in($target);
-
- # building the dist for real
- my $ok = eval {
- local $File::chdir::CWD = $target;
- $builders[0]->build;
- local $ENV{PERL5LIB} =
- join $Config::Config{path_sep},
- map { $abstarget->subdir('blib', $_) } qw{ arch lib };
- system(@$args) and die "error while running: @$args";
- 1;
- };
-
- if ($ok) {
- $self->log("all's well; removing $target");
- $target->rmtree;
- } else {
- my $error = $@ || '(unknown error)';
- $self->log($error);
- $self->log("left failed dist in place at $target");
- exit 1;
- }
+ $self->zilla->run_in_build($args);
}
1;
@@ -67,35 +29,35 @@ Dist::Zilla::App::Command::run - run stuff in a dir where your dist is built
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
- $ dzil run ./bin/myscript
- $ dzil run prove -bv t/mytest.t
- $ dzil run bash
+ $ dzil run ./bin/myscript
+ $ dzil run prove -bv t/mytest.t
+ $ dzil run bash
=head1 DESCRIPTION
-This command will dzil-build your dist, then build the distribution
-and finally run a command in this directory. It's ultimately like
+This command will build your dist with Dist::Zilla, then build the
+distribution and then run a command in the build directory. It's like
doing this:
- dzil build
- rsync -avp My-Project-version/ .build/
- cd .build
- perl Makefile.PL # or perl Build.PL
- make # or ./Build
- export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch
- <your command as defined by rest of params>
+ dzil build
+ rsync -avp My-Project-version/ .build/
+ cd .build
+ perl Makefile.PL # or perl Build.PL
+ make # or ./Build
+ export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch
+ <your command as defined by rest of params>
Except for the fact it's built directly in a subdir of .build (like
F<.build/asdf123>).
A command returning with an non-zero error code will left the build
-directory behind for analysis, and dzil will exit with status 1.
+directory behind for analysis, and dzil will exit with a non-zero status.
Otherwise, the build directory will be removed and dzil will exit
-with status 0.
+with status zero.
=head1 AUTHOR
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::smoke;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::smoke::VERSION = '2.100960';
+}
# ABSTRACT: smoke your dist
use Dist::Zilla::App -command;
require Dist::Zilla::App::Command::test;
@@ -29,7 +31,7 @@ Dist::Zilla::App::Command::smoke - smoke your dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::App::Command::test;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::test::VERSION = '2.100960';
+}
# ABSTRACT: test your dist
use Dist::Zilla::App -command;
@@ -13,48 +15,7 @@ sub abstract { 'test your dist' }
sub execute {
my ($self, $opt, $arg) = @_;
- Carp::croak("you can't release without any TestRunner plugins")
- unless my @testers = $self->zilla->plugins_with(-TestRunner)->flatten;
-
- require Dist::Zilla;
- require File::chdir;
- require File::Temp;
- require Path::Class;
-
- my $build_root = Path::Class::dir('.build');
- $build_root->mkpath unless -d $build_root;
-
- my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
- $self->log("building test distribution under $target");
-
- local $ENV{AUTHOR_TESTING} = 1;
- local $ENV{RELEASE_TESTING} = 1;
-
- $self->zilla->ensure_built_in($target);
-
- my $error;
-
- for my $tester ( @testers ) {
- undef $error;
- eval {
- local $File::chdir::CWD = $target;
- $error = $tester->test( $target );
- 1;
- } or do {
- $error = $@;
- };
- last if $error;
- }
-
- if ( $error ) {
- $self->log($error);
- $self->log("left failed dist in place at $target");
- exit 1; # Indicate test failure
- } else {
- $self->log("all's well; removing $target");
- $target->rmtree;
- }
-
+ $self->zilla->test;
}
1;
@@ -68,36 +29,37 @@ Dist::Zilla::App::Command::test - test your dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
-Test your distribution.
+Test your distribution:
- dzil test
+ dzil test
This runs with AUTHOR_TESTING and RELEASE_TESTING environment variables turned
-on, so its ultimately like doing this:
+on, so it's like doing this:
- export AUTHOR_TESTING=1
- export RELEASE_TESTING=1
- dzil build
- rsync -avp My-Project-Version/ .build/
- cd .build;
- perl Makefile.PL
- make
- make test
+ export AUTHOR_TESTING=1
+ export RELEASE_TESTING=1
+ dzil build
+ rsync -avp My-Project-Version/ .build/
+ cd .build;
+ perl Makefile.PL
+ make
+ make test
Except for the fact it's built directly in a subdir of .build (like
F<.build/ASDF123>).
-A build that fails tests will be left behind for analysis, and dzil
-will exit with status 1. If the tests are successful, the build
-directory will be removed and dzil will exit with status 0.
+A build that fails tests will be left behind for analysis, and F<dzil> will
+exit a non-zero value. If the tests are successful, the build directory will
+be removed and F<dzil> will exit with status 0.
=head1 SEE ALSO
-The heavy lifting of this module is now done by L<Dist::Zilla::Role::TestRunner> plugins.
+The heavy lifting of this module is now done by
+L<Dist::Zilla::Role::TestRunner> plugins.
=head1 AUTHOR
@@ -1,21 +1,16 @@
use strict;
use warnings;
package Dist::Zilla::App::Command;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::Command::VERSION = '2.100960';
+}
# ABSTRACT: base class for dzil commands
use App::Cmd::Setup -command;
use Moose::Autobox;
sub zilla {
- my ($self) = @_;
-
- require Dist::Zilla;
- return $self->{__PACKAGE__}{zilla} ||= do {
- my $zilla = Dist::Zilla->from_config;
- $zilla->dzil_app($self->app);
- $zilla;
- }
+ return $_[0]->app->zilla;
}
@@ -26,8 +21,7 @@ sub config {
sub log {
- require Dist::Zilla::Util;
- shift; Dist::Zilla::Util->_log($_[0]);
+ $_[0]->zilla->log($_[1]);
}
1;
@@ -41,7 +35,7 @@ Dist::Zilla::App::Command - base class for dzil commands
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 METHODS
@@ -50,6 +44,8 @@ version 1.100160
This returns the Dist::Zilla object in use by the command. If none has yet
been constructed, one will be by calling C<< Dist::Zilla->from_config >>.
+(This method just delegates to the Dist::Zilla::App object!)
+
=head2 config
This method returns the configuration for the current command.
@@ -0,0 +1,109 @@
+package Dist::Zilla::App::Tester;
+BEGIN {
+ $Dist::Zilla::App::Tester::VERSION = '2.100960';
+}
+use base 'App::Cmd::Tester';
+use App::Cmd::Tester 0.306 (); # result_class, ->app
+# ABSTRACT: testing library for Dist::Zilla::App
+
+use Dist::Zilla::App;
+use File::Copy::Recursive qw(dircopy);
+use File::pushd ();
+use File::Spec;
+use File::Temp;
+use Path::Class;
+
+use Sub::Exporter::Util ();
+use Sub::Exporter -setup => {
+ exports => [ test_dzil => Sub::Exporter::Util::curry_method() ],
+ groups => [ default => [ qw(test_dzil) ] ],
+};
+
+sub result_class { 'Dist::Zilla::App::Tester::Result' }
+
+sub test_dzil {
+ my ($self, $source, $argv, $arg) = @_;
+ $arg ||= {};
+
+ local @INC = map {; File::Spec->rel2abs($_) } @INC;
+
+ my $tmpdir = $arg->{tempdir} || File::Temp::tempdir(CLEANUP => 1);
+ my $root = dir($tmpdir)->subdir('source');
+ $root->mkpath;
+
+ dircopy($source, $root);
+
+ my $wd = File::pushd::pushd($root);
+
+ local $ENV{DZIL_TESTING} = 1;
+ my $result = $self->test_app('Dist::Zilla::App' => $argv);
+ $result->{tempdir} = $tempdir;
+
+ return $result;
+}
+
+{
+ package Dist::Zilla::App::Tester::Result;
+BEGIN {
+ $Dist::Zilla::App::Tester::Result::VERSION = '2.100960';
+}
+ BEGIN { our @ISA = qw(App::Cmd::Tester::Result); }
+
+ sub tempdir {
+ my ($self) = @_;
+ return $self->{tempdir};
+ }
+
+ sub zilla {
+ my ($self) = @_;
+ return $self->app->zilla;
+ }
+
+ sub build_dir {
+ my ($self) = @_;
+ return $self->zilla->built_in;
+ }
+
+ sub clear_log_events {
+ my ($self) = @_;
+ $self->app->zilla->logger->logger->clear_events;
+ }
+
+ sub log_events {
+ my ($self) = @_;
+ $self->app->zilla->logger->logger->events;
+ }
+
+ sub log_messages {
+ my ($self) = @_;
+ [ map {; $_->{message} } @{ $self->app->zilla->logger->logger->events } ];
+ }
+}
+
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::App::Tester - testing library for Dist::Zilla::App
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,9 +1,11 @@
use strict;
use warnings;
package Dist::Zilla::App;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::App::VERSION = '2.100960';
+}
# ABSTRACT: Dist::Zilla's App::Cmd
-use App::Cmd::Setup -app;
+use App::Cmd::Setup 0.307 -app; # need ->app in Result of Tester, GLD vers
use Carp ();
use Dist::Zilla::Config::Finder;
@@ -48,13 +50,58 @@ sub config_for {
sub global_opt_spec {
return (
- [ "inc|I=s@", "additional \@INC dirs", {
+ [ "verbose|v:s@", "log additional output" ],
+ [ "inc|I=s@", "additional \@INC dirs", {
callbacks => { 'always fine' => sub { unshift @INC, @{$_[0]}; } }
} ]
);
}
+sub logger {
+ my ($self) = @_;
+ $self->{__logger__} ||= Log::Dispatchouli->new({
+ ident => 'Dist::Zilla',
+ to_stdout => 1,
+ log_pid => 0,
+ to_self => ($ENV{DZIL_TESTING} ? 1 : 0),
+ quiet_fatal => 'stdout',
+ });
+}
+
+sub zilla {
+ my ($self) = @_;
+
+ require Dist::Zilla;
+
+ return $self->{__PACKAGE__}{zilla} ||= do {
+ my @v_plugins = $self->global_options->verbose
+ ? grep { length } @{ $self->global_options->verbose }
+ : ();
+
+ my $verbose = $self->global_options->verbose && ! @v_plugins;
+
+ $self->logger->set_debug($verbose ? 1 : 0);
+
+ my $core_debug = grep { m/\A[-_]\z/ } @v_plugins;
+
+ my $zilla = Dist::Zilla->from_config({
+ chrome => $self,
+ });
+
+ $zilla->logger->set_debug($verbose ? 1 : 0);
+
+ VERBOSE_PLUGIN: for my $plugin_name (grep { ! m{\A[-_]\z} } @v_plugins) {
+ $zilla->log_fatal("can't find plugin $plugin_name to set debug mode")
+ unless my $plugin = $zilla->plugin_named($plugin_name);
+
+ $plugin->logger->set_debug(1);
+ }
+
+ $zilla;
+ }
+}
+
1;
__END__
@@ -66,7 +113,14 @@ Dist::Zilla::App - Dist::Zilla's App::Cmd
=head1 VERSION
-version 1.100160
+version 2.100960
+
+=head1 METHODS
+
+=head2 zilla
+
+This returns the Dist::Zilla object in use by the command. If none has yet
+been constructed, one will be by calling C<< Dist::Zilla->from_config >>.
=head1 AUTHOR
@@ -1,5 +1,7 @@
package Dist::Zilla::Config::Finder;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Config::Finder::VERSION = '2.100960';
+}
use Moose;
extends 'Config::MVP::Reader::Finder';
with 'Dist::Zilla::Config';
@@ -24,7 +26,7 @@ Dist::Zilla::Config::Finder - the reader for dist.ini files
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 AUTHOR
@@ -1,5 +1,7 @@
package Dist::Zilla::Config::Perl;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Config::Perl::VERSION = '2.100960';
+}
use Moose;
with qw(Config::MVP::Reader::Findable);
with qw(Dist::Zilla::Config);
@@ -57,7 +59,7 @@ Dist::Zilla::Config::Perl - the reader for dist.pl files
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,8 +1,12 @@
package Dist::Zilla::Config;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Config::VERSION = '2.100960';
+}
use Moose::Role;
# ABSTRACT: stored configuration loader role
+use Config::MVP 0.100780; # fix mvp_* method laziness
+
with q(Config::MVP::Reader) => { -excludes => 'build_assembler' };
use Dist::Zilla::Util::MVPAssembler;
@@ -34,7 +38,7 @@ Dist::Zilla::Config - stored configuration loader role
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,55 @@
+package Dist::Zilla::File::FromCode;
+BEGIN {
+ $Dist::Zilla::File::FromCode::VERSION = '2.100960';
+}
+# ABSTRACT: a file whose content is (re-)built on demand
+use Moose;
+
+
+has code => (
+ is => 'rw',
+ isa => 'CodeRef|Str',
+ required => 1,
+);
+
+sub content {
+ my ($self) = @_;
+
+ my $code = $self->code;
+ return $self->$code;
+}
+
+with 'Dist::Zilla::Role::File';
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::File::FromCode - a file whose content is (re-)built on demand
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This represents a file whose contents will be generated on demand from a
+callback or method name.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::File::InMemory;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::File::InMemory::VERSION = '2.100960';
+}
# ABSTRACT: a file that you build entirely in memory
use Moose;
@@ -24,7 +26,7 @@ Dist::Zilla::File::InMemory - a file that you build entirely in memory
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::File::OnDisk;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::File::OnDisk::VERSION = '2.100960';
+}
# ABSTRACT: a file that comes from your filesystem
use Moose;
@@ -45,7 +47,7 @@ Dist::Zilla::File::OnDisk - a file that comes from your filesystem
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,88 +0,0 @@
-package Dist::Zilla::Plugin::AllFiles;
-our $VERSION = '1.100160';
-# ABSTRACT: gather all the files in your dist's root
-use Moose;
-use Moose::Autobox;
-use MooseX::Types::Path::Class qw(Dir File);
-with 'Dist::Zilla::Role::FileGatherer';
-
-
-use File::Find::Rule;
-use File::HomeDir;
-use File::Spec;
-
-has root => (
- is => 'ro',
- isa => Dir,
- lazy => 1,
- coerce => 1,
- required => 1,
- default => sub { shift->zilla->root },
-);
-
-has prefix => (
- is => 'ro',
- isa => 'Str',
- default => '',
-);
-
-sub gather_files {
- my ($self) = @_;
-
- my $root = "" . $self->root;
- $root =~ s{^~([\\/])}{File::HomeDir->my_home . $1}e;
- $root = Path::Class::dir($root);
-
- my @files =
- map { Dist::Zilla::File::OnDisk->new({ name => $_ }) }
- File::Find::Rule
- ->not( File::Find::Rule->name(qr/^\./) )
- ->file
- ->in($root);
-
- for my $file (@files) {
- (my $newname = $file->name) =~ s{\A\Q$root\E[\\/]}{}g;
- $newname = File::Spec->catdir($self->prefix, $newname) if $self->prefix;
-
- $file->name($newname);
- $self->add_file($file);
- }
-
- return;
-}
-
-__PACKAGE__->meta->make_immutable;
-no Moose;
-1;
-
-__END__
-=pod
-
-=head1 NAME
-
-Dist::Zilla::Plugin::AllFiles - gather all the files in your dist's root
-
-=head1 VERSION
-
-version 1.100160
-
-=head1 DESCRIPTION
-
-This is a very, very simple L<FileGatherer|Dist::Zilla::FileGatherer> plugin.
-It looks in the directory named in the L</root> attribute and adds all the
-files it finds there. If the root begins with a tilde, the tilde is replaced
-with the current user's home directory according to L<File::HomeDir>.
-
-=head1 AUTHOR
-
- Ricardo SIGNES <rjbs@cpan.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by Ricardo SIGNES.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
@@ -0,0 +1,151 @@
+package Dist::Zilla::Plugin::AutoPrereq;
+BEGIN {
+ $Dist::Zilla::Plugin::AutoPrereq::VERSION = '2.100960';
+}
+use Moose;
+with(
+ 'Dist::Zilla::Role::PrereqSource',
+ 'Dist::Zilla::Role::FileFinderUser' => {
+ default_finders => [ ':InstallModules', ':ExecFiles' ],
+ },
+ 'Dist::Zilla::Role::FileFinderUser' => {
+ method => 'found_test_files',
+ finder_arg_names => [ 'test_finder' ],
+ default_finders => [ ':TestFiles' ],
+ },
+);
+
+# ABSTRACT: automatically extract prereqs from your modules
+
+use Perl::PrereqScanner 0.100830; # bugfixes
+use PPI;
+use Version::Requirements 0.100630; # merge with 0-min bug
+use version;
+
+
+# skiplist - a regex
+has skip => (
+ is => 'ro',
+ predicate => 'has_skip',
+);
+
+sub register_prereqs {
+ my $self = shift;
+
+ my $req = Version::Requirements->new;
+ my @modules;
+
+ my @sets = (
+ [ runtime => 'found_files' ],
+ [ test => 'found_test_files' ],
+ );
+
+ my %runtime_final;
+
+ for my $fileset (@sets) {
+ my ($phase, $method) = @$fileset;
+
+ my $files = $self->$method;
+
+ foreach my $file (@$files) {
+ # parse only perl files
+ next unless $file->name =~ /\.(?:pm|pl|t)$/i
+ || $file->content =~ /^#!(?:.*)perl(?:$|\s)/;
+
+ # store module name, to trim it from require list later on
+ my $module = $file->name;
+ $module =~ s{^(?:t/)?lib/}{};
+ $module =~ s{\.pm$}{};
+ $module =~ s{/}{::}g;
+ push @modules, $module;
+
+ # parse a file, and merge with existing prereqs
+ my $file_req = Perl::PrereqScanner->new->scan_string($file->content);
+
+ $req->add_requirements($file_req);
+ }
+
+ # remove prereqs shipped with current dist
+ $req->clear_requirement($_) for @modules;
+
+ # remove prereqs from skiplist
+ if ($self->has_skip && $self->skip) {
+ my $skip = $self->skip;
+ my $re = qr/$skip/;
+
+ foreach my $k ($req->required_modules) {
+ $req->clear_requirement($k) if $k =~ $re;
+ }
+ }
+
+ # we're done, return what we've found
+ my %got = %{ $req->as_string_hash };
+ if ($phase eq 'runtime') {
+ %runtime_final = %got;
+ } else {
+ delete $got{$_} for
+ grep { exists $got{$_} and $runtime_final{$_} ge $got{$_} }
+ keys %runtime_final;
+ }
+
+ $self->zilla->register_prereqs({ phase => $phase }, %got);
+ }
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+1;
+
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::AutoPrereq - automatically extract prereqs from your modules
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 SYNOPSIS
+
+In your F<dist.ini>:
+
+ [AutoPrereq]
+ skip = ^Foo|Bar$
+
+=head1 DESCRIPTION
+
+This plugin will extract loosely your distribution prerequisites from
+your files using L<Perl::PrereqScanner>.
+
+If some prereqs are not found, you can still add them manually with the
+L<Dist::Zilla::Plugin::Prereq> plugin.
+
+This plugin will skip the modules shipped within your dist.
+
+=head1 ATTRIBUTES
+
+=head2 skip
+
+This string will be used as a regular expression. Any module names matching
+this regex will not be registered as prerequisites.
+
+=head1 CREDITS
+
+This plugin was originally contributed by Jerome Quelin.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::AutoVersion;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::AutoVersion::VERSION = '2.100960';
+}
# ABSTRACT: take care of numbering versions so you don't have to
use Moose;
with(
@@ -7,7 +9,7 @@ with(
'Dist::Zilla::Role::TextTemplate',
);
-use DateTime ();
+use DateTime 0.44 (); # CLDR fixes
@@ -30,7 +32,9 @@ has format => (
is => 'ro',
isa => 'Str',
required => 1,
- default => q[{{ $major }}.{{ cldr('yyDDD') }}{{ sprintf '%01u', ($ENV{N} || 0) }}],
+ default => q<{{ $major }}.{{ cldr('yyDDD') }}>
+ . q<{{ sprintf('%01u', ($ENV{N} || 0)) }}>
+ . q<{{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}}>
);
sub provide_version {
@@ -60,7 +64,7 @@ Dist::Zilla::Plugin::AutoVersion - take care of numbering versions so you don't
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -86,7 +90,9 @@ which consult the L<DateTime> documentation).
The default value is:
- {{ $major }}.{{ cldr('yyDDD') }}{{ sprintf '%01u', ($ENV{N} || 0) }}
+ {{ $major }}.{{ cldr('yyDDD') }}
+ {{ sprintf('%01u', ($ENV{N} || 0)) }}
+ {{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}}
=head1 AUTHOR
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::BumpVersion;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::BumpVersion::VERSION = '2.100960';
+}
# ABSTRACT: bump the configured version number by one before building
use Moose;
with 'Dist::Zilla::Role::BeforeBuild';
@@ -38,7 +40,7 @@ Dist::Zilla::Plugin::BumpVersion - bump the configured version number by one bef
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -0,0 +1,74 @@
+package Dist::Zilla::Plugin::ConfirmRelease;
+BEGIN {
+ $Dist::Zilla::Plugin::ConfirmRelease::VERSION = '2.100960';
+}
+# ABSTRACT: prompt for confirmation before releasing
+
+use ExtUtils::MakeMaker ();
+
+use Moose;
+with 'Dist::Zilla::Role::BeforeRelease';
+
+sub before_release {
+ my ($self, $tgz) = @_;
+
+ my $prompt = "\n*** Preparing to upload $tgz to CPAN ***\n\n" .
+ "Do you want to continue the release process? (yes/no)";
+
+ my $default = exists $ENV{DZIL_CONFIRMRELEASE_DEFAULT}
+ ? $ENV{DZIL_CONFIRMRELEASE_DEFAULT}
+ : "no" ;
+
+ my $answer = ExtUtils::MakeMaker::prompt($prompt, $default);
+
+ if ($answer !~ /\A(?:y|ye|yes)\z/i) {
+ $self->log_fatal("Aborting release");
+ }
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+1;
+
+
+
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::ConfirmRelease - prompt for confirmation before releasing
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This plugin prompts the author whether or not to continue before releasing
+the distribution to CPAN. It gives authors a chance to abort before
+they upload.
+
+The default is "no", but you can set the environment variable
+C<DZIL_CONFIRMRELEASE_DEFAULT> to "yes" if you just want to hit enter to
+release.
+
+This plugin uses C<ExtUtils::MakeMaker::prompt()>, so setting
+C<PERL_MM_USE_DEFAULT> to a true value will accept the default without
+prompting.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
+
+__END__
+
@@ -0,0 +1,60 @@
+package Dist::Zilla::Plugin::ExecDir;
+BEGIN {
+ $Dist::Zilla::Plugin::ExecDir::VERSION = '2.100960';
+}
+# ABSTRACT: install a directory's contents as executables
+use Moose;
+
+use Moose::Autobox;
+
+
+has dir => (
+ is => 'ro',
+ isa => 'Str',
+ default => 'bin',
+);
+
+sub find_files {
+ my ($self) = @_;
+
+ my $dir = $self->dir;
+ my $files = $self->zilla->files->grep(sub {
+ #warn $_->name;
+ index($_->name, "$dir/") == 0 });
+}
+
+with 'Dist::Zilla::Role::ExecFiles';
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::ExecDir - install a directory's contents as executables
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 SYNOPSIS
+
+In your F<dist.ini>:
+
+ [ExecDir]
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::ExtraTests;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::ExtraTests::VERSION = '2.100960';
+}
# ABSTRACT: rewrite ./xt tests to ./t tests with skips
use Moose;
with 'Dist::Zilla::Role::FileMunger';
@@ -13,7 +15,6 @@ sub munge_file {
$self->log("rewriting $1 test " . $file->name);
-
$self->$method($file);
}
@@ -66,7 +67,7 @@ Dist::Zilla::Plugin::ExtraTests - rewrite ./xt tests to ./t tests with skips
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,16 +1,23 @@
package Dist::Zilla::Plugin::FakeRelease;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::FakeRelease::VERSION = '2.100960';
+}
# ABSTRACT: fake plugin to test release
use Moose;
-
with 'Dist::Zilla::Role::Releaser';
sub release {
my $self = shift;
- die '[FakeRelease] DIST_ZILLA_FAKERELEASE_FAIL set, aborting'
- if $ENV{DIST_ZILLA_FAKERELEASE_FAIL};
- $self->log( '[FakeRelease] Fake realase happening (nothing was really done)' );
+
+ for my $env (
+ 'DIST_ZILLA_FAKERELEASE_FAIL', # old
+ 'DZIL_FAKERELEASE_FAIL', # new
+ ) {
+ $self->log_fatal("$env set, aborting") if $ENV{$env};
+ }
+
+ $self->log('Fake release happening (nothing was really done)');
}
no Moose;
@@ -18,6 +25,7 @@ __PACKAGE__->meta->make_immutable;
1;
+
=pod
=head1 NAME
@@ -26,7 +34,7 @@ Dist::Zilla::Plugin::FakeRelease - fake plugin to test release
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -36,9 +44,9 @@ implementing C<BeforeRelease> and C<AfterRelease>.
When this plugin does the release, it will just log a message and finish.
-If you happen to have a C<DIST_ZILLA_FAKERELEASE_FAIL> environment var
-set, the plugin will die instead of logging and exiting nicely. This can
-be interesting for authors wanting to test reliably that release failed.
+If you set the environment variable C<DZIL_FAKERELEASE_FAIL> to a true value,
+the plugin will die instead of doing nothing. This can be usefulfor
+authors wanting to test reliably that release failed.
=head1 AUTHOR
@@ -0,0 +1,71 @@
+package Dist::Zilla::Plugin::FinderCode;
+BEGIN {
+ $Dist::Zilla::Plugin::FinderCode::VERSION = '2.100960';
+}
+use Moose;
+with 'Dist::Zilla::Role::FileFinder';
+# ABSTRACT: a callback-based FileFinder plugin
+
+use Moose::Autobox;
+use Moose::Util::TypeConstraints;
+use namespace::autoclean;
+
+has code => (
+ is => 'ro',
+ isa => 'CodeRef',
+ required => 1,
+);
+
+has style => (
+ is => 'ro',
+ isa => enum([ qw(grep list) ]),
+ required => 1,
+);
+
+sub find_files {
+ my ($self) = @_;
+
+ my $method = '_find_via_' . $self->style;
+
+ $self->$method;
+}
+
+sub _find_via_grep {
+ my ($self) = @_;
+
+ $self->zilla->files->grep($self->code);
+}
+
+sub _find_via_list {
+ my ($self) = @_;
+
+ my $code = $self->code;
+ $self->$code;
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::FinderCode - a callback-based FileFinder plugin
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -0,0 +1,101 @@
+package Dist::Zilla::Plugin::GatherDir;
+BEGIN {
+ $Dist::Zilla::Plugin::GatherDir::VERSION = '2.100960';
+}
+# ABSTRACT: gather all the files in a directory
+use Moose;
+use Moose::Autobox;
+use MooseX::Types::Path::Class qw(Dir File);
+with 'Dist::Zilla::Role::FileGatherer';
+
+
+use File::Find::Rule;
+use File::HomeDir;
+use File::Spec;
+use Path::Class;
+
+use namespace::autoclean;
+
+has root => (
+ is => 'ro',
+ isa => Dir,
+ lazy => 1,
+ coerce => 1,
+ required => 1,
+ default => sub { shift->zilla->root },
+);
+
+has prefix => (
+ is => 'ro',
+ isa => 'Str',
+ default => '',
+);
+
+has include_dotfiles => (
+ is => 'ro',
+ isa => 'Bool',
+ default => 0,
+);
+
+sub gather_files {
+ my ($self) = @_;
+
+ my $root = "" . $self->root;
+ $root =~ s{^~([\\/])}{File::HomeDir->my_home . $1}e;
+ $root = Path::Class::dir($root);
+
+ my @files;
+ for my $filename (File::Find::Rule->file->in($root)) {
+ next if ! $self->include_dotfiles and file($filename)->basename =~ qr/^\./;
+ push @files, Dist::Zilla::File::OnDisk->new({
+ name => $filename,
+ mode => (stat $filename)[2] & 0755, # kill world-writeability
+ });
+ }
+
+ for my $file (@files) {
+ (my $newname = $file->name) =~ s{\A\Q$root\E[\\/]}{}g;
+ $newname = File::Spec->catdir($self->prefix, $newname) if $self->prefix;
+
+ $file->name($newname);
+ $self->add_file($file);
+ }
+
+ return;
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::GatherDir - gather all the files in a directory
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This is a very, very simple L<FileGatherer|Dist::Zilla::FileGatherer> plugin.
+It looks in the directory named in the L</root> attribute and adds all the
+files it finds there. If the root begins with a tilde, the tilde is replaced
+with the current user's home directory according to L<File::HomeDir>.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,12 +1,14 @@
package Dist::Zilla::Plugin::InlineFiles;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::InlineFiles::VERSION = '2.100960';
+}
# ABSTRACT: files in a data section
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::FileGatherer';
-use Data::Section -setup;
+use Data::Section 0.004 -setup; # fixed header_re
use Dist::Zilla::File::InMemory;
sub gather_files {
@@ -40,7 +42,7 @@ Dist::Zilla::Plugin::InlineFiles - files in a data section
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,79 +0,0 @@
-package Dist::Zilla::Plugin::InstallDirs;
-our $VERSION = '1.100160';
-# ABSTRACT: mark directory contents for installation
-use Moose;
-with 'Dist::Zilla::Role::Plugin';
-use Moose::Autobox;
-
-
-sub mvp_multivalue_args { qw(bin share) }
-
-has bin => (
- is => 'ro',
- isa => 'ArrayRef[Str]',
- lazy => 1,
- default => sub { [ qw(bin) ] },
-);
-
-has share => (
- is => 'ro',
- isa => 'ArrayRef[Str]',
- lazy => 1,
- default => sub {
- my ($self) = @_;
- if ($self->zilla->files->grep(sub { $_->name =~ m{\Ashare/} })->length) {
- return [ qw(share) ];
- } else {
- return [];
- }
- },
-);
-
-__PACKAGE__->meta->make_immutable;
-no Moose;
-1;
-
-__END__
-=pod
-
-=head1 NAME
-
-Dist::Zilla::Plugin::InstallDirs - mark directory contents for installation
-
-=head1 VERSION
-
-version 1.100160
-
-=head1 SYNOPSIS
-
-In your F<dist.ini>:
-
- [InstallDirs]
- bin = scripts
- bin = extra_scripts
-
-=head1 DESCRIPTION
-
-This plugin marks the contents of certain directories as files to be installed
-under special locations.
-
-C<bin> indicates directories that contain executable files to install. If no
-value is given, the directory C<bin> will be used.
-
-C<share> indicates directories that contain shared content to install for use
-with L<File::ShareDir>. If no value is given, it will try to guess whether or
-not F<./share> should be used.
-
-=head1 AUTHOR
-
- Ricardo SIGNES <rjbs@cpan.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by Ricardo SIGNES.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::License;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::License::VERSION = '2.100960';
+}
# ABSTRACT: output a LICENSE file
use Moose;
with 'Dist::Zilla::Role::FileGatherer';
@@ -32,7 +34,7 @@ Dist::Zilla::Plugin::License - output a LICENSE file
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,13 +1,14 @@
package Dist::Zilla::Plugin::MakeMaker;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::MakeMaker::VERSION = '2.100960';
+}
# ABSTRACT: build a Makefile.PL that uses ExtUtils::MakeMaker
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::BuildRunner';
-with 'Dist::Zilla::Role::FixedPrereqs';
+with 'Dist::Zilla::Role::PrereqSource';
with 'Dist::Zilla::Role::InstallTool';
-with 'Dist::Zilla::Role::MetaProvider';
with 'Dist::Zilla::Role::TestRunner';
with 'Dist::Zilla::Role::TextTemplate';
@@ -25,14 +26,17 @@ use warnings;
{{ $perl_prereq ? qq{ BEGIN { require $perl_prereq; } } : ''; }}
-use ExtUtils::MakeMaker 6.11;
+use ExtUtils::MakeMaker {{ $eumm_version }};
{{ $share_dir_block[0] }}
my {{ $WriteMakefileArgs }}
-delete $WriteMakefileArgs{LICENSE}
- unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
+delete $WriteMakefileArgs{BUILD_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.56) };
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
@@ -40,18 +44,20 @@ WriteMakefile(%WriteMakefileArgs);
|;
-sub metadata {
+sub register_prereqs {
my ($self) = @_;
- my @dir_plugins = $self->zilla->plugins
- ->grep( sub { $_->isa('Dist::Zilla::Plugin::InstallDirs') })
- ->flatten;
+ $self->zilla->register_prereqs(
+ { phase => 'configure' },
+ 'ExtUtils::MakeMaker' => $self->eumm_version,
+ );
- return {} unless uniq map {; $_->share->flatten } @dir_plugins;
+ return unless $self->zilla->_share_dir;
- return {
- configure_requires => { 'File::ShareDir::Install' => 0 },
- };
+ $self->zilla->register_prereqs(
+ { phase => 'configure' },
+ 'File::ShareDir::Install' => 0.03,
+ );
}
sub setup_installer {
@@ -59,22 +65,10 @@ sub setup_installer {
(my $name = $self->zilla->name) =~ s/-/::/g;
- # XXX: SHAMELESSLY COPIED AND PASTED INTO ModuleBuild -- rjbs, 2010-01-05
- my @dir_plugins = $self->zilla->plugins
- ->grep( sub { $_->isa('Dist::Zilla::Plugin::InstallDirs') })
- ->flatten;
-
- my @bin_dirs = uniq map {; $_->bin->flatten } @dir_plugins;
- my @share_dirs = uniq map {; $_->share->flatten } @dir_plugins;
-
- confess "can't install more than one ShareDir" if @share_dirs > 1;
+ my @exe_files =
+ $self->zilla->find_files(':ExecFiles')->map(sub { $_->name })->flatten;
- my @exe_files = $self->zilla->files
- ->grep(sub { my $f = $_; any { $f->name =~ qr{^\Q$_\E[\\/]} } @bin_dirs; })
- ->map( sub { $_->name })
- ->flatten;
-
- confess "can't install files with whitespace in their names"
+ $self->log_fatal("can't install files with whitespace in their names")
if grep { /\s/ } @exe_files;
my %test_dirs;
@@ -87,15 +81,16 @@ sub setup_installer {
my @share_dir_block = (q{}, q{});
- if ($share_dirs[0]) {
- my $share_dir = quotemeta $share_dirs[0];
+ if (my $share_dir = $self->zilla->_share_dir) {
+ my $share_dir = quotemeta $share_dir;
@share_dir_block = (
qq{use File::ShareDir::Install;\ninstall_share "$share_dir";\n},
- qq{package MY;\nuse File::ShareDir::Install qw(postamble);\n},
+ qq{package\nMY;\nuse File::ShareDir::Install qw(postamble);\n},
);
}
- my $prereq = $self->zilla->prereq;
+ my $meta_prereq = $self->zilla->prereq->as_distmeta;
+ my $perl_prereq = delete $meta_prereq->{requires}{perl};
my %write_makefile_args = (
DISTNAME => $self->zilla->name,
@@ -105,12 +100,16 @@ sub setup_installer {
VERSION => $self->zilla->version,
LICENSE => $self->zilla->license->meta_yml_name,
EXE_FILES => [ @exe_files ],
- PREREQ_PM => {
- map {; $_ => $prereq->{$_} } grep { $_ ne 'perl' } keys %$prereq
- },
+
+ CONFIGURE_REQUIRES => delete $meta_prereq->{configure_requires},
+ BUILD_REQUIRES => delete $meta_prereq->{build_requires},
+ PREREQ_PM => delete $meta_prereq->{requires},
+
test => { TESTS => join q{ }, sort keys %test_dirs },
);
+ $self->__write_makefile_args(\%write_makefile_args);
+
my $makefile_args_dumper = Data::Dumper->new(
[ \%write_makefile_args ],
[ '*WriteMakefileArgs' ],
@@ -119,7 +118,8 @@ sub setup_installer {
my $content = $self->fill_in_string(
$template,
{
- perl_prereq => \($self->prereq->{perl}),
+ eumm_version => \($self->eumm_version),
+ perl_prereq => \$perl_prereq,
share_dir_block => \@share_dir_block,
WriteMakefileArgs => \($makefile_args_dumper->Dump),
},
@@ -134,39 +134,34 @@ sub setup_installer {
return;
}
+# XXX: Just here to facilitate testing. -- rjbs, 2010-03-20
+has __write_makefile_args => (
+ is => 'rw',
+ isa => 'HashRef',
+);
+
sub build {
my $self = shift;
+
system($^X => 'Makefile.PL') and die "error with Makefile.PL\n";
system('make') and die "error running make\n";
+
return;
}
sub test {
my ( $self, $target ) = @_;
- ## no critic Punctuation
+
$self->build;
system('make test') and die "error running make test\n";
- return;
-}
-
-sub prereq {
- my ($self) = @_;
- my $has_share = $self->zilla->plugins
- ->grep(sub { $_->isa('Dist::Zilla::Plugins::InstallDirs') })
- ->grep(sub { $_->share->length > 0 })
- ->length;
-
- return {
- 'ExtUtils::MakeMaker' => $self->eumm_version,
- ($has_share ? ('File::ShareDir::Install' => 0.03) : ()),
- };
+ return;
}
has 'eumm_version' => (
isa => 'Str',
is => 'rw',
- default => '6.11',
+ default => '6.31',
);
__PACKAGE__->meta->make_immutable;
@@ -182,7 +177,7 @@ Dist::Zilla::Plugin::MakeMaker - build a Makefile.PL that uses ExtUtils::MakeMak
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,10 +1,14 @@
package Dist::Zilla::Plugin::Manifest;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::Manifest::VERSION = '2.100960';
+}
# ABSTRACT: build a MANIFEST file
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::InstallTool';
+use Dist::Zilla::File::InMemory;
+
sub setup_installer {
my ($self, $arg) = @_;
@@ -31,7 +35,7 @@ Dist::Zilla::Plugin::Manifest - build a MANIFEST file
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,10 +1,12 @@
package Dist::Zilla::Plugin::ManifestSkip;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::ManifestSkip::VERSION = '2.100960';
+}
# ABSTRACT: decline to build files that appear in a MANIFEST.SKIP-like file
use Moose;
with 'Dist::Zilla::Role::FilePruner';
-use ExtUtils::Manifest;
+use ExtUtils::Manifest 1.54; # public maniskip routine
has skipfile => (is => 'ro', required => 1, default => 'MANIFEST.SKIP');
@@ -33,7 +35,7 @@ Dist::Zilla::Plugin::ManifestSkip - decline to build files that appear in a MANI
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,65 @@
+package Dist::Zilla::Plugin::MetaConfig;
+BEGIN {
+ $Dist::Zilla::Plugin::MetaConfig::VERSION = '2.100960';
+}
+# ABSTRACT: summarize Dist::Zilla configuration into distmeta
+use Moose;
+with 'Dist::Zilla::Role::MetaProvider';
+
+sub metadata {
+ my ($self) = @_;
+
+ my $dump = { };
+
+ my @plugins;
+ $dump->{plugins} = \@plugins;
+
+ my $config = $self->zilla->dump_config;
+ $dump->{zilla} = {
+ class => $self->zilla->meta->name,
+ version => $self->zilla->VERSION,
+ (keys %$config ? (config => $config) : ()),
+ };
+
+ for my $plugin (@{ $self->zilla->plugins }) {
+ my $config = $plugin->dump_config;
+
+ push @plugins, {
+ class => $plugin->meta->name,
+ name => $plugin->plugin_name,
+ version => $plugin->VERSION,
+ (keys %$config ? (config => $config) : ()),
+ };
+ }
+
+ return { x_Dist_Zilla => $dump };
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable(inline_constructor => 0);
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,22 +1,27 @@
package Dist::Zilla::Plugin::MetaJSON;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::MetaJSON::VERSION = '2.100960';
+}
# ABSTRACT: produce a META.json
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::FileGatherer';
+use Dist::Zilla::File::FromCode;
use Hash::Merge::Simple ();
+use JSON 2;
sub gather_files {
my ($self, $arg) = @_;
- require Dist::Zilla::File::InMemory;
- require JSON;
-
- my $file = Dist::Zilla::File::InMemory->new({
- name => 'META.json',
- content => JSON->new->ascii(1)->pretty->encode($self->zilla->distmeta) . "\n",
+ my $zilla = $self->zilla;
+ my $file = Dist::Zilla::File::FromCode->new({
+ name => 'META.json',
+ code => sub {
+ JSON->new->ascii(1)->canonical(1)->pretty->encode($zilla->distmeta)
+ . "\n";
+ },
});
$self->add_file($file);
@@ -36,7 +41,7 @@ Dist::Zilla::Plugin::MetaJSON - produce a META.json
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::MetaResources;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::MetaResources::VERSION = '2.100960';
+}
# ABSTRACT: provide arbitrary "resources" for distribution metadata
use Moose;
with 'Dist::Zilla::Role::MetaProvider';
@@ -44,7 +46,7 @@ Dist::Zilla::Plugin::MetaResources - provide arbitrary "resources" for distribut
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::MetaTests;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::MetaTests::VERSION = '2.100960';
+}
# ABSTRACT: common extra tests for META.yml
use Moose;
extends 'Dist::Zilla::Plugin::InlineFiles';
@@ -19,14 +21,14 @@ Dist::Zilla::Plugin::MetaTests - common extra tests for META.yml
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
following files:
- xt/release/meta-yaml.t - a standard Test::CPAN::Meta test
+ xt/release/meta-yaml.t - a standard Test::CPAN::Meta test
=head1 AUTHOR
@@ -43,7 +45,7 @@ the same terms as the Perl 5 programming language system itself.
__DATA__
-___[ xt/release/meta-yaml.t ]___
+___[ xt/release/distmeta.t ]___
#!perl
use Test::More;
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::MetaYAML;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::MetaYAML::VERSION = '2.100960';
+}
# ABSTRACT: produce a META.yml
use Moose;
use Moose::Autobox;
@@ -11,12 +13,15 @@ use Hash::Merge::Simple ();
sub gather_files {
my ($self, $arg) = @_;
- require Dist::Zilla::File::InMemory;
+ require Dist::Zilla::File::FromCode;
require YAML::Tiny;
- my $file = Dist::Zilla::File::InMemory->new({
- name => 'META.yml',
- content => YAML::Tiny::Dump($self->zilla->distmeta),
+ my $zilla = $self->zilla;
+ my $file = Dist::Zilla::File::FromCode->new({
+ name => 'META.yml',
+ code => sub {
+ YAML::Tiny::Dump($zilla->distmeta);
+ },
});
$self->add_file($file);
@@ -36,7 +41,7 @@ Dist::Zilla::Plugin::MetaYAML - produce a META.yml
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,17 +1,21 @@
package Dist::Zilla::Plugin::ModuleBuild;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::ModuleBuild::VERSION = '2.100960';
+}
# ABSTRACT: build a Build.PL that uses Module::Build
use List::MoreUtils qw(any uniq);
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::BuildRunner';
+with 'Dist::Zilla::Role::PrereqSource';
with 'Dist::Zilla::Role::InstallTool';
with 'Dist::Zilla::Role::TextTemplate';
with 'Dist::Zilla::Role::TestRunner';
-with 'Dist::Zilla::Role::MetaProvider';
use Dist::Zilla::File::InMemory;
use List::MoreUtils qw(any uniq);
+use Data::Dumper;
+
has 'mb_version' => (
@@ -24,7 +28,7 @@ my $template = q|
use strict;
use warnings;
-use Module::Build 0.3601;
+use Module::Build {{ $plugin->mb_version }};
my {{ $module_build_args }}
@@ -33,38 +37,32 @@ my $build = Module::Build->new(%module_build_args);
$build->create_build_script;
|;
-sub metadata {
+sub register_prereqs {
my ($self) = @_;
- return {
- configure_requires => { 'Module::Build' => $self->mb_version },
- build_requires => { 'Module::Build' => $self->mb_version },
- };
+
+ $self->zilla->register_prereqs(
+ { phase => 'configure' },
+ 'Module::Build' => $self->mb_version,
+ );
+
+ $self->zilla->register_prereqs(
+ { phase => 'build' },
+ 'Module::Build' => $self->mb_version,
+ );
}
sub setup_installer {
my ($self, $arg) = @_;
- Carp::croak("can't build a Build.PL; license has no known META.yml value")
+ $self->log_fatal("can't build Build.PL; license has no known META.yml value")
unless $self->zilla->license->meta_yml_name;
(my $name = $self->zilla->name) =~ s/-/::/g;
- # XXX: SHAMELESSLY COPIED AND PASTED FROM MakeMaker -- rjbs, 2010-01-05
- my @dir_plugins = $self->zilla->plugins
- ->grep( sub { $_->isa('Dist::Zilla::Plugin::InstallDirs') })
- ->flatten;
-
- my @bin_dirs = uniq map {; $_->bin->flatten } @dir_plugins;
- my @share_dirs = uniq map {; $_->share->flatten } @dir_plugins;
-
- confess "can't install more than one ShareDir" if @share_dirs > 1;
-
- my @exe_files = $self->zilla->files
- ->grep(sub { my $f = $_; any { $f->name =~ qr{^\Q$_\E[\\/]} } @bin_dirs; })
- ->map( sub { $_->name })
- ->flatten;
+ my @exe_files =
+ $self->zilla->find_files(':ExecFiles')->map(sub { $_->name })->flatten;
- confess "can't install files with whitespace in their names"
+ $self->log_fatal("can't install files with whitespace in their names")
if grep { /\s/ } @exe_files;
my %module_build_args = (
@@ -72,12 +70,18 @@ sub setup_installer {
license => $self->zilla->license->meta_yml_name,
dist_abstract => $self->zilla->abstract,
dist_name => $self->zilla->name,
+ dist_version => $self->zilla->version,
dist_author => [ $self->zilla->authors->flatten ],
- requires => $self->zilla->prereq,
script_files => \@exe_files,
- (defined $share_dirs[0] ? (share_dir => $share_dirs[0]) : ()),
+ ($self->zilla->_share_dir ? (share_dir => $self->zilla->_share_dir) : ()),
+
+ # I believe it is a happy coincidence, for the moment, that this happens to
+ # return just the same thing that is needed here. -- rjbs, 2010-01-22
+ $self->zilla->prereq->as_distmeta->flatten,
);
+ $self->__module_build_args(\%module_build_args);
+
my $module_build_dumper = Data::Dumper->new(
[ \%module_build_args ],
[ '*module_build_args' ],
@@ -86,6 +90,7 @@ sub setup_installer {
my $content = $self->fill_in_string(
$template,
{
+ plugin => \$self,
module_build_args => \($module_build_dumper->Dump),
},
);
@@ -99,18 +104,27 @@ sub setup_installer {
return;
}
+# XXX: Just here to facilitate testing. -- rjbs, 2010-03-20
+has __module_build_args => (
+ is => 'rw',
+ isa => 'HashRef',
+);
+
sub build {
my $self = shift;
+
system($^X => 'Build.PL') and die "error with Build.PL\n";
system('./Build') and die "error running ./Build\n";
+
return;
}
sub test {
- my ( $self, $target ) = @_;
- ## no critic Punctuation
+ my ($self, $target) = @_;
+
$self->build;
system('./Build test') and die "error running ./Build test\n";
+
return;
}
@@ -127,7 +141,7 @@ Dist::Zilla::Plugin::ModuleBuild - build a Build.PL that uses Module::Build
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::NextRelease;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::NextRelease::VERSION = '2.100960';
+}
# ABSTRACT: update the next release number in your changelog
use Moose;
@@ -7,8 +9,8 @@ with 'Dist::Zilla::Role::FileMunger';
with 'Dist::Zilla::Role::TextTemplate';
with 'Dist::Zilla::Role::AfterRelease';
-use DateTime;
-use String::Formatter stringf => {
+use DateTime 0.44; # CLDR fixes
+use String::Formatter 0.100680 stringf => {
-as => '_format_version',
input_processor => 'require_single_input',
@@ -40,10 +42,11 @@ sub section_header {
return _format_version($self->format, $self->zilla);
}
-sub munge_file {
- my ($self, $file) = @_;
+sub munge_files {
+ my ($self) = @_;
- return unless $file->name eq $self->filename;
+ my ($file) = grep { $_->name eq $self->filename } @{ $self->zilla->files };
+ return unless $file;
my $content = $self->fill_in_string(
$file->content,
@@ -96,7 +99,7 @@ Dist::Zilla::Plugin::NextRelease - update the next release number in your change
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,15 +1,31 @@
package Dist::Zilla::Plugin::PkgVersion;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::PkgVersion::VERSION = '2.100960';
+}
# ABSTRACT: add a $VERSION to your packages
use Moose;
-with 'Dist::Zilla::Role::FileMunger';
+with(
+ 'Dist::Zilla::Role::FileMunger',
+ 'Dist::Zilla::Role::FileFinderUser' => {
+ default_finders => [ ':InstallModules' ],
+ },
+);
use PPI;
+sub munge_files {
+ my ($self) = @_;
+
+ $self->munge_file($_) for @{ $self->found_files };
+}
+
sub munge_file {
my ($self, $file) = @_;
+ # XXX: for test purposes, for now! evil! -- rjbs, 2010-03-17
+ return if $file->name =~ /^corpus\//;
+
return if $file->name =~ /\.t$/i;
return $self->munge_perl($file) if $file->name =~ /\.(?:pm|pl)$/i;
return $self->munge_perl($file) if $file->content =~ /^#!(?:.*)perl(?:$|\s)/;
@@ -41,11 +57,17 @@ sub munge_perl {
return unless my $package_stmts = $document->find('PPI::Statement::Package');
- # $hack is here so that when we scan *this* document we
- my $version_doc = PPI::Document->new(\"our \$VERSION\x20=\x20'$version';\n");
- my @children = $version_doc->schildren;
-
for my $stmt (@$package_stmts) {
+ my $package = $stmt->namespace;
+
+ # the \x20 hack is here so that when we scan *this* document we don't find
+ # an assignment to version; it shouldn't be needed, but it's been annoying
+ # enough in the past that I'm keeping it here until tests are better
+ my $perl = "BEGIN {\n \$$package\::VERSION\x20=\x20'$version';\n}\n";
+
+ my $version_doc = PPI::Document->new(\$perl);
+ my @children = $version_doc->schildren;
+
Carp::carp("error inserting version in " . $file->name)
unless $stmt->insert_after($children[0]->clone)
and $stmt->insert_after( PPI::Token::Whitespace->new("\n") );
@@ -67,7 +89,7 @@ Dist::Zilla::Plugin::PkgVersion - add a $VERSION to your packages
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,61 @@
+package Dist::Zilla::Plugin::PodCoverageTests;
+BEGIN {
+ $Dist::Zilla::Plugin::PodCoverageTests::VERSION = '2.100960';
+}
+# ABSTRACT: a release test for Pod coverage
+use Moose;
+extends 'Dist::Zilla::Plugin::InlineFiles';
+
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+
+
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::PodCoverageTests - a release test for Pod coverage
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
+following files:
+
+ xt/release/pod-coverage.t - a standard Test::Pod::Coverage test
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
+
+__DATA__
+___[ xt/release/pod-coverage.t ]___
+#!perl
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
+ if $@;
+
+eval "use Pod::Coverage::TrustPod";
+plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
+ if $@;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
@@ -0,0 +1,55 @@
+package Dist::Zilla::Plugin::PodSyntaxTests;
+BEGIN {
+ $Dist::Zilla::Plugin::PodSyntaxTests::VERSION = '2.100960';
+}
+# ABSTRACT: a release test for Pod syntax
+use Moose;
+extends 'Dist::Zilla::Plugin::InlineFiles';
+
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+
+
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::PodSyntaxTests - a release test for Pod syntax
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
+following files:
+
+ xt/release/pod-syntax.t - a standard Test::Pod test
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
+
+__DATA__
+___[ xt/release/pod-syntax.t ]___
+#!perl
+use Test::More;
+
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+all_pod_files_ok();
@@ -1,69 +0,0 @@
-package Dist::Zilla::Plugin::PodTests;
-our $VERSION = '1.100160';
-# ABSTRACT: common extra tests for pod
-use Moose;
-extends 'Dist::Zilla::Plugin::InlineFiles';
-
-
-__PACKAGE__->meta->make_immutable;
-no Moose;
-1;
-
-
-
-=pod
-
-=head1 NAME
-
-Dist::Zilla::Plugin::PodTests - common extra tests for pod
-
-=head1 VERSION
-
-version 1.100160
-
-=head1 DESCRIPTION
-
-This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
-following files:
-
- xt/release/pod-coverage.t - a standard Test::Pod::Coverage test
- xt/release/pod-syntax.t - a standard Test::Pod test
-
-=head1 AUTHOR
-
- Ricardo SIGNES <rjbs@cpan.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by Ricardo SIGNES.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
-
-__DATA__
-___[ xt/release/pod-coverage.t ]___
-#!perl
-
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.08";
-plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
- if $@;
-
-eval "use Pod::Coverage::TrustPod";
-plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
- if $@;
-
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
-
-___[ xt/release/pod-syntax.t ]___
-#!perl
-use Test::More;
-
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-
-all_pod_files_ok();
@@ -1,21 +1,25 @@
package Dist::Zilla::Plugin::PodVersion;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::PodVersion::VERSION = '2.100960';
+}
# ABSTRACT: add a VERSION head1 to each Perl document
use Moose;
-with 'Dist::Zilla::Role::FileMunger';
-
+with(
+ 'Dist::Zilla::Role::FileMunger',
+ 'Dist::Zilla::Role::FileFinderUser' => {
+ default_finders => [ ':InstallModules' ],
+ },
+);
-sub munge_file {
- my ($self, $file) = @_;
- return $self->munge_pod($file)
- if $file->name =~ /\.pm$/i and $file->name !~ m{^t/};
+sub munge_files {
+ my ($self) = @_;
- return unless $file->content =~ /^#!(?:.*)perl(?:$|\s)/;
+ $self->munge_file($_) for @{ $self->found_files };
+}
- return if $file->name eq 'Makefile.PL';
- return if $file->name eq 'Build.PL';
- return if $file->name =~ /\.t$/;
+sub munge_file {
+ my ($self, $file) = @_;
return $self->munge_pod($file);
}
@@ -70,7 +74,7 @@ Dist::Zilla::Plugin::PodVersion - add a VERSION head1 to each Perl document
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,9 +1,69 @@
package Dist::Zilla::Plugin::Prereq;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::Prereq::VERSION = '2.100960';
+}
# ABSTRACT: list simple prerequisites
use Moose;
-with 'Dist::Zilla::Role::FixedPrereqs';
+with 'Dist::Zilla::Role::PrereqSource';
+
+
+sub __from_name {
+ my ($self) = @_;
+ my $name = $self->plugin_name;
+
+ # such as C<configure>, C<build>, C<test> and C<runtime>. Values are
+ # relationship such as C<requires>, C<prefers>, or C<recommends>. The
+
+ my ($phase, $type) = $name =~ /\A
+ (Build|Test|Runtime|Configure)
+ (Requires|Prefers|Recommends)
+ \z/x;
+
+ return ($phase, $type);
+}
+
+has prereq_phase => (
+ is => 'ro',
+ isa => 'Str',
+ lazy => 1,
+ init_arg => 'phase',
+ default => sub {
+ my ($self) = @_;
+ my ($phase, $type) = $self->__from_name;
+ $phase ||= 'runtime';
+ $phase = lc $phase;
+ $phase = 'build' if $phase eq 'test'; # XXX: Temporary -- rjbs, 2010-03-20
+ return $phase;
+ },
+);
+has prereq_type => (
+ is => 'ro',
+ isa => 'Str',
+ lazy => 1,
+ init_arg => 'type',
+ default => sub {
+ my ($self) = @_;
+ my ($phase, $type) = $self->__from_name;
+ $type ||= 'requires';
+ $type = lc $type;
+ return $type;
+ },
+);
+
+around dump_config => sub {
+ my ($orig, $self) = @_;
+ my $config = $self->$orig;
+
+ my $this_config = {
+ type => $self->prereq_type,
+ phase => $self->prereq_phase,
+ };
+
+ $config->{'' . __PACKAGE__} = $this_config;
+
+ return $config;
+};
has _prereq => (
is => 'ro',
@@ -18,14 +78,36 @@ sub BUILDARGS {
my $zilla = delete $copy{zilla};
my $name = delete $copy{plugin_name};
+ my @dashed = grep { /^-/ } keys %copy;
+
+ my %other;
+ for my $dkey (@dashed) {
+ (my $key = $dkey) =~ s/^-//;
+
+ $other{ $key } = delete $copy{ $dkey };
+ }
+
+ confess "don't try to pass -_prereq as a build arg!" if $other{_prereq};
+
return {
zilla => $zilla,
plugin_name => $name,
_prereq => \%copy,
+ %other,
}
}
-sub prereq { shift->_prereq }
+sub register_prereqs {
+ my ($self) = @_;
+
+ $self->zilla->register_prereqs(
+ {
+ type => $self->prereq_type,
+ phase => $self->prereq_phase,
+ },
+ %{ $self->_prereq },
+ );
+}
no Moose;
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
@@ -40,7 +122,7 @@ Dist::Zilla::Plugin::Prereq - list simple prerequisites
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::PruneCruft;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::PruneCruft::VERSION = '2.100960';
+}
# ABSTRACT: prune stuff that you probably don't mean to include
use Moose;
use Moose::Autobox;
@@ -14,6 +16,7 @@ sub exclude_file {
return 1 if index($file->name, $self->zilla->name . '-') == 0;
return 1 if $file->name =~ /\A\./;
return 1 if $file->name =~ /\A(?:Build|Makefile)\z/;
+ return 1 if $file->name eq 'MYMETA.yml';
return;
}
@@ -40,7 +43,7 @@ Dist::Zilla::Plugin::PruneCruft - prune stuff that you probably don't mean to in
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::PruneFiles;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::PruneFiles::VERSION = '2.100960';
+}
# ABSTRACT: prune arbirary files from the dist
use Moose;
use Moose::Autobox;
@@ -7,7 +9,7 @@ with 'Dist::Zilla::Role::FilePruner';
sub mvp_multivalue_args { qw(filenames) }
-# sub mvp_aliases { warn "..."; return { filename => 'filenames' } }
+sub mvp_aliases { return { filename => 'filenames' } }
has filenames => (
@@ -43,7 +45,7 @@ Dist::Zilla::Plugin::PruneFiles - prune arbirary files from the dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,5 +1,7 @@
package Dist::Zilla::Plugin::Readme;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::Readme::VERSION = '2.100960';
+}
# ABSTRACT: build a README file
use Moose;
use Moose::Autobox;
@@ -14,12 +16,13 @@ sub gather_files {
my $template = q|
-This archive contains the distribution {{ $dist->name }}, version
-{{ $dist->version }}:
+This archive contains the distribution {{ $dist->name }},
+version {{ $dist->version }}:
{{ $dist->abstract }}
{{ $dist->license->notice }}
+
|;
my $content = $self->fill_in_string(
@@ -49,7 +52,7 @@ Dist::Zilla::Plugin::Readme - build a README file
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,51 @@
+package Dist::Zilla::Plugin::ShareDir;
+BEGIN {
+ $Dist::Zilla::Plugin::ShareDir::VERSION = '2.100960';
+}
+# ABSTRACT: install a directory's contents as "ShareDir" content
+use Moose;
+
+use Moose::Autobox;
+
+
+has dir => (
+ is => 'ro',
+ isa => 'Str',
+ default => 'share',
+);
+
+with 'Dist::Zilla::Role::ShareDir';
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::ShareDir - install a directory's contents as "ShareDir" content
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 SYNOPSIS
+
+In your F<dist.ini>:
+
+ [ShareDir]
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -0,0 +1,83 @@
+package Dist::Zilla::Plugin::TestRelease;
+BEGIN {
+ $Dist::Zilla::Plugin::TestRelease::VERSION = '2.100960';
+}
+use Moose;
+with 'Dist::Zilla::Role::BeforeRelease';
+# ABSTRACT: extract archive and run tests before releasing the dist
+
+
+use Archive::Tar;
+use File::pushd ();
+use Moose::Autobox;
+use Path::Class ();
+
+sub before_release {
+ my ($self, $tgz) = @_;
+ $tgz = $tgz->absolute;
+
+ my $build_root = $self->zilla->root->subdir('.build');
+ $build_root->mkpath unless -d $build_root;
+
+ my $tmpdir = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
+
+ $self->log("Extracting $tgz to $tmpdir");
+
+ my @files = do {
+ my $wd = File::pushd::pushd($tmpdir);
+ Archive::Tar->extract_archive("$tgz");
+ };
+
+ $self->log_fatal([ "Failed to extract archive: %s", Archive::Tar->error ])
+ unless @files;
+
+ # Run tests on the extracted tarball:
+ my $target = $tmpdir->subdir($files[0]); # Should be the root of the tarball
+
+ local $ENV{RELEASE_TESTING} = 1;
+ $self->zilla->run_tests_in($target);
+
+ $self->log("all's well; removing $tmpdir");
+ $tmpdir->rmtree;
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Plugin::TestRelease - extract archive and run tests before releasing the dist
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This plugin runs before a release happens. It will extract the to-be-released
+archive into a temporary directory and use the TestRunner plugins to run its
+tests. If the tests fail, the release is aborted and the temporary directory
+is left in place. If the tests pass, the temporary directory is cleaned up and
+the release process continues.
+
+=head1 CREDITS
+
+This plugin was originally contributed by Christopher J. Madsen.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,14 +1,31 @@
package Dist::Zilla::Plugin::UploadToCPAN;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Plugin::UploadToCPAN::VERSION = '2.100960';
+}
# ABSTRACT: upload the dist to CPAN
use Moose;
with 'Dist::Zilla::Role::Releaser';
+use CPAN::Uploader 0.100660; # log method
use File::HomeDir;
use File::Spec;
+use Scalar::Util qw(weaken);
+
+use namespace::autoclean;
-use CPAN::Uploader;
+{
+ package
+ Dist::Zilla::Plugin::UploadToCPAN::_Uploader;
+BEGIN {
+ $Dist::Zilla::Plugin::UploadToCPAN::_Uploader::VERSION = '2.100960';
+}
+ use base 'CPAN::Uploader';
+ sub log {
+ my $self = shift;
+ $self->{'Dist::Zilla'}{plugin}->log(@_);
+ }
+}
has user => (
is => 'ro',
@@ -17,7 +34,7 @@ has user => (
required => 1,
default => sub {
my ($self) = @_;
- return unless my $app = $self->zilla->dzil_app;
+ return unless my $app = $self->zilla->chrome;
my $user = $app->config_for('Dist::Zilla::App::Command::release')->{user};
return $user if defined $user;
return $self->pause_cfg->{user};
@@ -31,7 +48,7 @@ has password => (
required => 1,
default => sub {
my ($self) = @_;
- return unless my $app = $self->zilla->dzil_app;
+ return unless my $app = $self->zilla->chrome;
my $pass = $app->config_for('Dist::Zilla::App::Command::release')->{password};
return $pass if defined $pass;
return $self->pause_cfg->{password};
@@ -67,19 +84,32 @@ has pause_cfg => (
},
);
-sub release {
- my ($self, $archive) = @_;
+has uploader => (
+ is => 'ro',
+ isa => 'CPAN::Uploader',
+ lazy => 1,
+ default => sub {
+ my ($self) = @_;
- my $user = $self->user;
- my $password = $self->password;
+ my $user = $self->user;
+ my $password = $self->password;
- CPAN::Uploader->upload_file(
- "$archive",
- {
+ my $uploader = Dist::Zilla::Plugin::UploadToCPAN::_Uploader->new({
user => $user,
password => $password,
- },
- );
+ });
+
+ $uploader->{'Dist::Zilla'}{plugin} = $self;
+ weaken $uploader->{'Dist::Zilla'}{plugin};
+
+ return $uploader;
+ }
+);
+
+sub release {
+ my ($self, $archive) = @_;
+
+ $self->uploader->upload_file("$archive");
}
__PACKAGE__->meta->make_immutable;
@@ -95,7 +125,7 @@ Dist::Zilla::Plugin::UploadToCPAN - upload the dist to CPAN
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -0,0 +1,142 @@
+package Dist::Zilla::PluginBundle::Basic;
+BEGIN {
+ $Dist::Zilla::PluginBundle::Basic::VERSION = '2.100960';
+}
+# ABSTRACT: the basic plugins to maintain and release CPAN dists
+use Moose;
+use Moose::Autobox;
+with 'Dist::Zilla::Role::PluginBundle';
+
+sub bundle_config {
+ my ($self, $arg) = @_;
+
+ my @plugins = qw(
+ GatherDir
+ PruneCruft
+ ManifestSkip
+ MetaYAML
+ License
+ Readme
+ ExtraTests
+ ExecDir
+ ShareDir
+
+ MakeMaker
+ Manifest
+
+ TestRelease
+ ConfirmRelease
+ UploadToCPAN
+ );
+
+ my @config;
+ for (@plugins) {
+ my $class = "Dist::Zilla::Plugin::$_";
+ Class::MOP::load_class($class);
+
+ push @config, [ "$arg->{name}/$_" => $class => {} ];
+ }
+
+ return @config;
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+
+=pod
+
+=head1 NAME
+
+Dist::Zilla::PluginBundle::Basic - the basic plugins to maintain and release CPAN dists
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+This plugin is meant to be a basic "first step" bundle for using Dist::Zilla.
+It won't munge any of your code, but will generate a F<Makefile.PL> and allows
+easy, reliable releasing of distributions.
+
+It includes the following plugins with their default configuration:
+
+=over 4
+
+=item *
+
+L<Dist::Zilla::Plugin::GatherDir>
+
+=item *
+
+L<Dist::Zilla::Plugin::PruneCruft>
+
+=item *
+
+L<Dist::Zilla::Plugin::ManifestSkip>
+
+=item *
+
+L<Dist::Zilla::Plugin::MetaYAML>
+
+=item *
+
+L<Dist::Zilla::Plugin::License>
+
+=item *
+
+L<Dist::Zilla::Plugin::Readme>
+
+=item *
+
+L<Dist::Zilla::Plugin::ExtraTests>
+
+=item *
+
+L<Dist::Zilla::Plugin::ExecDir>
+
+=item *
+
+L<Dist::Zilla::Plugin::ShareDir>
+
+=item *
+
+L<Dist::Zilla::Plugin::MakeMaker>
+
+=item *
+
+L<Dist::Zilla::Plugin::Manifest>
+
+=item *
+
+L<Dist::Zilla::Plugin::TestRelease>
+
+=item *
+
+L<Dist::Zilla::Plugin::ConfirmRelease>
+
+=item *
+
+L<Dist::Zilla::Plugin::UploadToCPAN>
+
+=back
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
+
+__END__
+
+
@@ -1,36 +1,46 @@
package Dist::Zilla::PluginBundle::Classic;
-our $VERSION = '1.100160';
-# ABSTRACT: build something more or less like a "classic" CPAN dist
+BEGIN {
+ $Dist::Zilla::PluginBundle::Classic::VERSION = '2.100960';
+}
+# ABSTRACT: the classic (old) default configuration for Dist::Zilla
use Moose;
use Moose::Autobox;
with 'Dist::Zilla::Role::PluginBundle';
sub bundle_config {
- my ($self) = @_;
- my $class = (ref $self) || $self;
-
- my @classes = qw(
- Dist::Zilla::Plugin::AllFiles
- Dist::Zilla::Plugin::PruneCruft
- Dist::Zilla::Plugin::ManifestSkip
- Dist::Zilla::Plugin::MetaYAML
- Dist::Zilla::Plugin::License
- Dist::Zilla::Plugin::Readme
- Dist::Zilla::Plugin::PkgVersion
- Dist::Zilla::Plugin::PodVersion
- Dist::Zilla::Plugin::PodTests
- Dist::Zilla::Plugin::ExtraTests
- Dist::Zilla::Plugin::InstallDirs
-
- Dist::Zilla::Plugin::MakeMaker
- Dist::Zilla::Plugin::Manifest
-
- Dist::Zilla::Plugin::UploadToCPAN
+ my ($self, $arg) = @_;
+
+ my @plugins = qw(
+ GatherDir
+ PruneCruft
+ ManifestSkip
+ MetaYAML
+ License
+ Readme
+ PkgVersion
+ PodVersion
+ PodCoverageTests
+ PodSyntaxTests
+ ExtraTests
+ ExecDir
+ ShareDir
+
+ MakeMaker
+ Manifest
+
+ ConfirmRelease
+ UploadToCPAN
);
- eval "require $_; 1" or die for @classes; ## no critic Carp
+ my @config;
+ for (@plugins) {
+ my $class = "Dist::Zilla::Plugin::$_";
+ Class::MOP::load_class($class);
+
+ push @config, [ "$arg->{name}/$_" => $class => {} ];
+ }
- return @classes->map(sub { [ "$class/$_" => $_ => {} ] })->flatten;
+ return @config;
}
__PACKAGE__->meta->make_immutable;
@@ -42,48 +52,40 @@ no Moose;
=head1 NAME
-Dist::Zilla::PluginBundle::Classic - build something more or less like a "classic" CPAN dist
+Dist::Zilla::PluginBundle::Classic - the classic (old) default configuration for Dist::Zilla
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
-This bundle is meant to do just about everything needed for building a plain
-ol' CPAN distribution in the manner of our forefathers.
+This bundle is more or less the original configuration bundled with
+Dist::Zilla. More than likely, you'd rather be using
+L<@Basic|Dist::Zilla::PluginBundle::Basic> or a more complex bundle. This one
+will muck around with your code by adding C<$VERSION> declarations and will
+mess with you Pod by adding a C<=head1 VERSION> section, but it won't get you a
+lot of more useful features like autoversioning, autoprereqs, or Pod::Weaver.
It includes the following plugins with their default configuration:
-=over
-
-=item * L<Dist::Zilla::Plugin::AllFiles>
-
-=item * L<Dist::Zilla::Plugin::PruneCruft>
-
-=item * L<Dist::Zilla::Plugin::ManifestSkip>
-
-=item * L<Dist::Zilla::Plugin::MetaYAML>
-
-=item * L<Dist::Zilla::Plugin::License>
-
-=item * L<Dist::Zilla::Plugin::Readme>
-
-=item * L<Dist::Zilla::Plugin::PkgVersion>
-
-=item * L<Dist::Zilla::Plugin::PodVersion>
-
-=item * L<Dist::Zilla::Plugin::PodTests>
-
-=item * L<Dist::Zilla::Plugin::ExtraTests>
-
-=item * L<Dist::Zilla::Plugin::InstallDirs>
-
-=item * L<Dist::Zilla::Plugin::MakeMaker>
-
-=item * L<Dist::Zilla::Plugin::Manifest>
-
-=back
+* L<Dist::Zilla::Plugin::GatherDir>
+* L<Dist::Zilla::Plugin::PruneCruft>
+* L<Dist::Zilla::Plugin::ManifestSkip>
+* L<Dist::Zilla::Plugin::MetaYAML>
+* L<Dist::Zilla::Plugin::License>
+* L<Dist::Zilla::Plugin::Readme>
+* L<Dist::Zilla::Plugin::PkgVersion>
+* L<Dist::Zilla::Plugin::PodVersion>
+* L<Dist::Zilla::Plugin::PodCoverageTests>
+* L<Dist::Zilla::Plugin::PodSyntaxTests>
+* L<Dist::Zilla::Plugin::ExtraTests>
+* L<Dist::Zilla::Plugin::ExecDir>
+* L<Dist::Zilla::Plugin::ShareDir>
+* L<Dist::Zilla::Plugin::MakeMaker>
+* L<Dist::Zilla::Plugin::Manifest>
+* L<Dist::Zilla::Plugin::ConfirmRelease>
+* L<Dist::Zilla::Plugin::UploadToCPAN>
=head1 AUTHOR
@@ -0,0 +1,56 @@
+package Dist::Zilla::PluginBundle::FakeClassic;
+BEGIN {
+ $Dist::Zilla::PluginBundle::FakeClassic::VERSION = '2.100960';
+}
+# ABSTRACT: build something more or less like a "classic" CPAN dist
+use Moose;
+extends 'Dist::Zilla::PluginBundle::Classic';
+use Moose::Autobox;
+
+around bundle_config => sub {
+ my ($orig, $self, $arg) = @_;
+
+ my @config = $self->$orig($arg);
+
+ for my $i (0 .. $#config) {
+ if ($config[ $i ][1] eq 'Dist::Zilla::Plugin::UploadToCPAN') {
+ require Dist::Zilla::Plugin::FakeRelease;
+ $config[ $i ] = [
+ "$arg->{name}/FakeRelease",
+ 'Dist::Zilla::Plugin::FakeRelease',
+ $config[ $i ][2]
+ ];
+ }
+ }
+
+ return @config;
+};
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::PluginBundle::FakeClassic - build something more or less like a "classic" CPAN dist
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::PluginBundle::Filter;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::PluginBundle::Filter::VERSION = '2.100960';
+}
# ABSTRACT: use another bundle, with some plugins removed
use Moose;
use Moose::Autobox;
@@ -23,7 +25,11 @@ sub bundle_config {
eval "require $bundle; 1" or die;
- my @plugins = $bundle->bundle_config;
+ my @plugins = $bundle->bundle_config({
+ name => $section->{name}, # not 100% sure about this -- rjbs, 2010-03-06
+ package => $bundle,
+ payload => {},
+ });
return @plugins unless my $remove = $config->{remove};
@@ -50,7 +56,7 @@ Dist::Zilla::PluginBundle::Filter - use another bundle, with some plugins remove
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -0,0 +1,101 @@
+package Dist::Zilla::Prereqs;
+BEGIN {
+ $Dist::Zilla::Prereqs::VERSION = '2.100960';
+}
+# ABSTRACT: the prerequisites of a Dist::Zilla distribution
+use Moose;
+use Moose::Autobox;
+use MooseX::Types::Moose qw(Bool HashRef);
+
+use Hash::Merge::Simple ();
+use Path::Class ();
+use String::RewritePrefix;
+use Version::Requirements;
+
+use namespace::autoclean;
+
+has is_finalized => (
+ is => 'ro',
+ isa => Bool,
+ traits => [ qw(Bool) ],
+ default => 0,
+ handles => {
+ finalize => 'set',
+ },
+);
+
+has _guts => (
+ is => 'ro',
+ isa => HashRef,
+ default => sub { {} },
+ init_arg => undef,
+);
+
+sub as_distmeta {
+ my ($self) = @_;
+
+ my $distmeta = {
+ requires =>
+ ($self->_guts->{runtime}{requires} || Version::Requirements->new)
+ ->as_string_hash,
+ recommends =>
+ ($self->_guts->{runtime}{recommends} || Version::Requirements->new)
+ ->as_string_hash,
+ build_requires =>
+ ($self->_guts->{build}{requires} || Version::Requirements->new)
+ ->as_string_hash,
+ configure_requires =>
+ ($self->_guts->{configure}{requires} || Version::Requirements->new)
+ ->as_string_hash,
+ };
+
+ return $distmeta;
+}
+
+sub register_prereqs {
+ my $self = shift;
+ my $arg = ref($_[0]) ? shift(@_) : {};
+ my %prereq = @_;
+
+ confess "too late to register a prereq" if $self->is_finalized;
+
+ my $phase = $arg->{phase} || 'runtime';
+ my $type = $arg->{type} || 'requires';
+
+ $phase = 'build' if $phase eq 'test';
+
+ my $prereq = ($self->_guts->{$phase}{$type} ||= Version::Requirements->new);
+
+ while (my ($package, $version) = each %prereq) {
+ $prereq->add_minimum($package, $version);
+ }
+
+ return;
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Prereqs - the prerequisites of a Dist::Zilla distribution
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::AfterBuild;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::AfterBuild::VERSION = '2.100960';
+}
# ABSTRACT: something that runs after building is mostly complete
use Moose::Role;
@@ -19,7 +21,7 @@ Dist::Zilla::Role::AfterBuild - something that runs after building is mostly com
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -2,7 +2,9 @@ use strict;
use warnings;
package Dist::Zilla::Role::AfterRelease;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::AfterRelease::VERSION = '2.100960';
+}
# ABSTRACT: something that runs after release is mostly complete
use Moose::Role;
@@ -22,7 +24,7 @@ Dist::Zilla::Role::AfterRelease - something that runs after release is mostly co
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,45 @@
+package Dist::Zilla::Role::BeforeArchive;
+BEGIN {
+ $Dist::Zilla::Role::BeforeArchive::VERSION = '2.100960';
+}
+use Moose::Role;
+with 'Dist::Zilla::Role::Plugin';
+# ABSTRACT: something that runs before the archive file is built
+
+requires 'before_archive';
+
+no Moose::Role;
+1;
+
+
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::BeforeArchive - something that runs before the archive file is built
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+Plugins implementing this role have their C<before_archive> method
+called before the archive is actually built.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
+
+__END__
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::BeforeBuild;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::BeforeBuild::VERSION = '2.100960';
+}
# ABSTRACT: something that runs before building really begins
use Moose::Role;
@@ -19,7 +21,7 @@ Dist::Zilla::Role::BeforeBuild - something that runs before building really begi
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -2,7 +2,9 @@ use strict;
use warnings;
package Dist::Zilla::Role::BeforeRelease;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::BeforeRelease::VERSION = '2.100960';
+}
# ABSTRACT: something that runs before release really begins
use Moose::Role;
@@ -22,7 +24,7 @@ Dist::Zilla::Role::BeforeRelease - something that runs before release really beg
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,19 +1,18 @@
-use strict;
-use warnings;
-
package Dist::Zilla::Role::BuildRunner;
-our $VERSION = '1.100160';
-# ABSTRACT: something used as a delegating agent during 'dzil run'
-
+BEGIN {
+ $Dist::Zilla::Role::BuildRunner::VERSION = '2.100960';
+}
use Moose::Role;
-
with 'Dist::Zilla::Role::Plugin';
-requires 'test';
+# ABSTRACT: something used as a delegating agent during 'dzil run'
+
+requires 'build';
no Moose::Role;
1;
+__END__
=pod
=head1 NAME
@@ -22,31 +21,18 @@ Dist::Zilla::Role::BuildRunner - something used as a delegating agent during 'dz
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
Plugins implementing this role have their C<build> method called during
-C<dzil run>. It's passed the root directory of the build test dir.
+C<dzil run>. It's passed the root directory of the build test dir.
=head1 REQUIRED METHODS
-=head2 build()
+=head2 build
-This method should return C<undef> on success. Any other value is
-interpreted as an error message.
-
-Calling "die" inside build also will be caught.
-
-The following 2 subs should behave(mostly) the same:
-
- sub build {
- die "Failed";
- }
-
- sub build {
- return "Failed";
- }
+This method will throw an exception on failure.
=head1 AUTHOR
@@ -61,6 +47,3 @@ the same terms as the Perl 5 programming language system itself.
=cut
-
-__END__
-
@@ -0,0 +1,38 @@
+package Dist::Zilla::Role::ConfigDumper;
+BEGIN {
+ $Dist::Zilla::Role::ConfigDumper::VERSION = '2.100960';
+}
+# ABSTRACT: something that can dump its (public, simplified) configuraiton
+use Moose::Role;
+
+use namespace::autoclean;
+
+sub dump_config { return {}; }
+
+no Moose::Role;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::ConfigDumper - something that can dump its (public, simplified) configuraiton
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -0,0 +1,43 @@
+package Dist::Zilla::Role::ExecFiles;
+BEGIN {
+ $Dist::Zilla::Role::ExecFiles::VERSION = '2.100960';
+}
+use Moose::Role;
+with 'Dist::Zilla::Role::FileFinder';
+# ABSTRACT: something that finds files to install as executables
+
+requires 'dir';
+
+sub find_files {
+ my ($self) = @_;
+
+ my $dir = $self->dir;
+ my $files = $self->zilla->files->grep(sub { index($_->name, "$dir/") == 0 });
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::ExecFiles - something that finds files to install as executables
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,8 +1,14 @@
package Dist::Zilla::Role::File;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::File::VERSION = '2.100960';
+}
# ABSTRACT: something that can act like a file
use Moose::Role;
+use Moose::Util::TypeConstraints;
+
+use namespace::autoclean;
+
requires 'content';
@@ -17,6 +23,19 @@ has added_by => (
is => 'ro',
);
+
+my $safe_file_mode = subtype(
+ as 'Int',
+ where { not( $_ & 0002) },
+ message { "file mode would be world-writeable" }
+);
+
+has mode => (
+ is => 'rw',
+ isa => $safe_file_mode,
+ default => 0644,
+);
+
no Moose::Role;
1;
@@ -29,7 +48,7 @@ Dist::Zilla::Role::File - something that can act like a file
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -47,6 +66,11 @@ This is a string describing when and why the file was added to the
distribution. It will generally be set by a plugin implementing the
L<FileInjector|Dist::Zilla::Role::FileInjector> role.
+=head2 mode
+
+This is the mode with which the file should be written out. It's an integer
+with the usual C<chmod> semantics. It defaults to 0644.
+
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::FileFinder;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::FileFinder::VERSION = '2.100960';
+}
use Moose::Autobox;
# ABSTRACT: something that finds files within the distribution
use Moose::Role;
@@ -20,7 +22,7 @@ Dist::Zilla::Role::FileFinder - something that finds files within the distributi
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,95 @@
+package Dist::Zilla::Role::FileFinderUser;
+BEGIN {
+ $Dist::Zilla::Role::FileFinderUser::VERSION = '2.100960';
+}
+use MooseX::Role::Parameterized;
+# ABSTRACT: something that uses FileFinder plugins
+
+parameter finder_arg_names => (
+ isa => 'ArrayRef',
+ default => sub { [ 'finder' ] },
+);
+
+parameter default_finders => (
+ isa => 'ArrayRef',
+ required => 1,
+);
+
+parameter method => (
+ isa => 'Str',
+ default => 'found_files',
+);
+
+role {
+ my ($p) = @_;
+
+ my ($finder_arg, @finder_arg_aliases) = @{ $p->finder_arg_names };
+ confess "no finder arg names given!" unless $finder_arg;
+
+ around mvp_multivalue_args => sub {
+ my ($orig, $self) = @_;
+
+ my @start = $self->$orig;
+ return (@start, $finder_arg);
+ };
+
+ if (@finder_arg_aliases) {
+ around mvp_aliases => sub {
+ my ($orig, $self) = @_;
+
+ my $start = $self->$orig;
+
+ for my $alias (@finder_arg_aliases) {
+ confess "$alias is already an alias to $start->{$alias}"
+ if exists $start->{$alias} and $orig->{$alias} ne $finder_arg;
+ $start->{ $alias } = $finder_arg;
+ }
+
+ return $start;
+ };
+ }
+
+ has $finder_arg => (
+ is => 'ro',
+ isa => 'ArrayRef[Str]',
+ default => sub { [ @{ $p->default_finders } ] },
+ );
+
+ method $p->method => sub {
+ my ($self) = @_;
+
+ my @filesets = map {; $self->zilla->find_files($_) }
+ @{ $self->$finder_arg };
+
+ my %by_name = map {; $_->name, $_ } map { @$_ } @filesets;
+
+ return [ values %by_name ];
+ };
+};
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::FileFinderUser - something that uses FileFinder plugins
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::FileGatherer;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::FileGatherer::VERSION = '2.100960';
+}
use Moose::Autobox;
# ABSTRACT: something that gathers files into the distribution
use Moose::Role;
@@ -21,7 +23,7 @@ Dist::Zilla::Role::FileGatherer - something that gathers files into the distribu
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::FileInjector;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::FileInjector::VERSION = '2.100960';
+}
use Moose::Autobox;
# ABSTRACT: something that can add files to the distribution
use Moose::Role;
@@ -26,7 +28,7 @@ Dist::Zilla::Role::FileInjector - something that can add files to the distributi
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,16 +1,20 @@
package Dist::Zilla::Role::FileMunger;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::FileMunger::VERSION = '2.100960';
+}
# ABSTRACT: something that alters a file's destination or content
use Moose::Role;
use Moose::Autobox;
with 'Dist::Zilla::Role::Plugin';
-requires 'munge_file';
sub munge_files {
my ($self) = @_;
+ $self->log_fatal("no munge_file behavior implemented!")
+ unless $self->can('munge_file');
+
$self->munge_file($_) for $self->zilla->files->flatten;
}
@@ -26,7 +30,7 @@ Dist::Zilla::Role::FileMunger - something that alters a file's destination or co
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::FilePruner;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::FilePruner::VERSION = '2.100960';
+}
# ABSTRACT: something that removes found files from the distribution
use Moose::Role;
@@ -19,7 +21,7 @@ Dist::Zilla::Role::FilePruner - something that removes found files from the dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,42 +0,0 @@
-package Dist::Zilla::Role::FixedPrereqs;
-our $VERSION = '1.100160';
-# ABSTRACT: enumerate fixed (non-conditional) prerequisites
-use Moose::Role;
-
-
-with 'Dist::Zilla::Role::Plugin';
-requires 'prereq';
-
-no Moose::Role;
-1;
-
-__END__
-=pod
-
-=head1 NAME
-
-Dist::Zilla::Role::FixedPrereqs - enumerate fixed (non-conditional) prerequisites
-
-=head1 VERSION
-
-version 1.100160
-
-=head1 DESCRIPTION
-
-FixedPrereqs plugins have a C<prereq> method that should return a hashref of
-prerequisite package names and versions, indicating unconditional prerequisites
-to be merged together.
-
-=head1 AUTHOR
-
- Ricardo SIGNES <rjbs@cpan.org>
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by Ricardo SIGNES.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::InstallTool;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::InstallTool::VERSION = '2.100960';
+}
# ABSTRACT: something that creates an install program for a dist
use Moose::Role;
use Moose::Autobox;
@@ -21,7 +23,7 @@ Dist::Zilla::Role::InstallTool - something that creates an install program for a
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::MetaProvider;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::MetaProvider::VERSION = '2.100960';
+}
# ABSTRACT: something that provides metadata (for META.yml/json)
use Moose::Role;
with 'Dist::Zilla::Role::Plugin';
@@ -19,7 +21,7 @@ Dist::Zilla::Role::MetaProvider - something that provides metadata (for META.yml
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,8 +1,16 @@
package Dist::Zilla::Role::Plugin;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::Plugin::VERSION = '2.100960';
+}
# ABSTRACT: something that gets plugged in to Dist::Zilla
use Moose::Role;
+with 'Dist::Zilla::Role::ConfigDumper';
+
+use Params::Util qw(_HASHLIKE);
+
+use namespace::autoclean;
+
has plugin_name => (
is => 'ro',
@@ -16,10 +24,25 @@ has zilla => (
isa => 'Dist::Zilla',
required => 1,
weak_ref => 1,
- handles => [ qw(log) ],
);
+has logger => (
+ is => 'ro',
+ lazy => 1,
+ handles => [ qw(log log_debug log_fatal) ],
+ default => sub {
+ $_[0]->zilla->chrome->logger->proxy({
+ proxy_prefix => '[' . $_[0]->plugin_name . '] ',
+ });
+ },
+);
+
+# We define these effectively-pointless subs here to allow other roles to
+# modify them with around. -- rjbs, 2010-03-21
+sub mvp_multivalue_args {};
+sub mvp_aliases { return {} };
+
no Moose::Role;
1;
@@ -32,7 +55,7 @@ Dist::Zilla::Role::Plugin - something that gets plugged in to Dist::Zilla
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -43,8 +66,7 @@ methods and attributes that all plugins will need.
=head2 plugin_name
-The plugin name is generally determined when configuration is read. It is
-initialized by the C<=name> argument to the plugin's constructor.
+The plugin name is generally determined when configuration is read.
=head2 zilla
@@ -56,7 +78,7 @@ plugged.
=head2 log
The plugin's C<log> method delegates to the Dist::Zilla object's
-L<Dist::Zilla/log> method.
+L<Dist::Zilla/log> method after including a bit of argument-munging.
=head1 AUTHOR
@@ -1,6 +1,8 @@
package Dist::Zilla::Role::PluginBundle;
-our $VERSION = '1.100160';
-# ABSTRACT: a bundle of plugins
+BEGIN {
+ $Dist::Zilla::Role::PluginBundle::VERSION = '2.100960';
+}
+# ABSTRACT: something that bundles a bunch of plugins
use Moose::Role;
@@ -14,11 +16,11 @@ __END__
=head1 NAME
-Dist::Zilla::Role::PluginBundle - a bundle of plugins
+Dist::Zilla::Role::PluginBundle - something that bundles a bunch of plugins
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,43 @@
+package Dist::Zilla::Role::PrereqSource;
+BEGIN {
+ $Dist::Zilla::Role::PrereqSource::VERSION = '2.100960';
+}
+# ABSTRACT: something that registers prerequisites
+use Moose::Role;
+
+
+with 'Dist::Zilla::Role::Plugin';
+requires 'register_prereqs';
+
+no Moose::Role;
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::PrereqSource - something that registers prerequisites
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 DESCRIPTION
+
+PrereqSource plugins have a C<register_prereqs> method that should register
+prereqs with the Dist::Zilla object.
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::Releaser;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::Releaser::VERSION = '2.100960';
+}
# ABSTRACT: something that makes a release of the dist
use Moose::Role;
@@ -19,7 +21,7 @@ Dist::Zilla::Role::Releaser - something that makes a release of the dist
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,41 @@
+package Dist::Zilla::Role::ShareDir;
+BEGIN {
+ $Dist::Zilla::Role::ShareDir::VERSION = '2.100960';
+}
+use Moose::Role;
+with 'Dist::Zilla::Role::FileFinder';
+# ABSTRACT: something that picks a directory to install as shared files
+
+sub find_files {
+ my ($self) = @_;
+
+ my $dir = $self->dir;
+ my $files = $self->zilla->files->grep(sub { index($_->name, "$dir/") == 0 });
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Role::ShareDir - something that picks a directory to install as shared files
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,12 +1,10 @@
package Dist::Zilla::Role::TestRunner;
-our $VERSION = '1.100160';
-
-# ABSTRACT: something used as a delegating agent to 'dzil test'
-
+BEGIN {
+ $Dist::Zilla::Role::TestRunner::VERSION = '2.100960';
+}
use Moose::Role;
-
-
with 'Dist::Zilla::Role::Plugin';
+# ABSTRACT: something used as a delegating agent to 'dzil test'
requires 'test';
@@ -23,34 +21,18 @@ Dist::Zilla::Role::TestRunner - something used as a delegating agent to 'dzil te
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
Plugins implementing this role have their C<test> method called when
testing. It's passed the root directory of the build test dir.
-=head1 REQUIRED METHODS
+=head1 METHODS
=head2 test
- ->test( $build_dir )
-
-This method should return C<undef> on success.
-
-Any other value is interpreted as an error message, and no more tests are run.
-
-Calling "die" inside test also will be caught.
-
-The following 2 subs should behave(mostly) the same:
-
- sub test {
- die "Failed";
- }
-
- sub test {
- return "Failed";
- }
+This method should throw an exception on failure.
=head1 AUTHOR
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::TextTemplate;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::TextTemplate::VERSION = '2.100960';
+}
# ABSTRACT: something that renders a Text::Template template string
use Moose::Role;
@@ -40,7 +42,7 @@ Dist::Zilla::Role::TextTemplate - something that renders a Text::Template templa
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -1,5 +1,7 @@
package Dist::Zilla::Role::VersionProvider;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Role::VersionProvider::VERSION = '2.100960';
+}
# ABSTRACT: something that provides a version number for the dist
use Moose::Role;
@@ -19,7 +21,7 @@ Dist::Zilla::Role::VersionProvider - something that provides a version number fo
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -0,0 +1,170 @@
+package Dist::Zilla::Tester;
+BEGIN {
+ $Dist::Zilla::Tester::VERSION = '2.100960';
+}
+use Moose;
+extends 'Dist::Zilla';
+# ABSTRACT: a testing-enabling stand-in for Dist::Zilla
+
+use autodie;
+use File::Copy::Recursive qw(dircopy);
+use File::pushd ();
+use File::Spec;
+use File::Temp;
+use Path::Class;
+
+around from_config => sub {
+ my ($orig, $self, $arg, $tester_arg) = @_;
+
+ confess "dist_root required for from_config" unless $arg->{dist_root};
+
+ my $source = $arg->{dist_root};
+
+ my $tempdir_root = exists $tester_arg->{tempdir_root}
+ ? $tester_arg->{tempdir_root}
+ : 'tmp';
+
+ mkdir $tempdir_root if defined $tempdir_root and not -d $tempdir_root;
+
+ my $tempdir = dir( File::Temp::tempdir(
+ CLEANUP => 1,
+ (defined $tempdir_root ? (DIR => $tempdir_root) : ()),
+ ))->absolute;
+
+ my $root = $tempdir->subdir('source');
+ $root->mkpath;
+
+ dircopy($source, $root);
+
+ if ($tester_arg->{also_copy}) {
+ while (my ($src, $dest) = each %{ $tester_arg->{also_copy} }) {
+ dircopy($src, $tempdir->subdir($dest));
+ }
+ }
+
+ if (my $files = $tester_arg->{add_files}) {
+ while (my ($name, $content) = each %$files) {
+ my $fn = $tempdir->file($name);
+ $fn->dir->mkpath;
+ open my $fh, '>', $fn;
+ print { $fh } $content;
+ close $fh;
+ }
+ }
+
+ local $arg->{dist_root} = "$root";
+ local $arg->{chrome} = Dist::Zilla::Tester::UI->new;
+
+ local @INC = map {; ref($_) ? $_ : File::Spec->rel2abs($_) } @INC;
+
+ my $zilla = $self->$orig($arg);
+
+ $zilla->_set_tempdir($tempdir);
+
+ return $zilla;
+};
+
+around build_in => sub {
+ my ($orig, $self, $target) = @_;
+
+ # XXX: We *must eliminate* the need for this! It's only here because right
+ # now building a dist with (root <> cwd) doesn't work. -- rjbs, 2010-03-08
+ my $wd = File::pushd::pushd($self->root);
+
+ $target ||= do {
+ my $target = dir($self->tempdir)->subdir('build');
+ $target->mkpath;
+ $target;
+ };
+
+ return $self->$orig($target);
+};
+
+around release => sub {
+ my ($orig, $self) = @_;
+
+ # XXX: We *must eliminate* the need for this! It's only here because right
+ # now building a dist with (root <> cwd) doesn't work. -- rjbs, 2010-03-08
+ my $wd = File::pushd::pushd($self->root);
+
+ return $self->$orig;
+};
+
+
+{
+ package
+ Dist::Zilla::Tester::UI;
+BEGIN {
+ $Dist::Zilla::Tester::UI::VERSION = '2.100960';
+}
+
+ use Moose;
+ has logger => (
+ is => 'ro',
+ default => sub {
+ Log::Dispatchouli->new({
+ ident => 'Dist::Zilla::Tester',
+ log_pid => 0,
+ to_self => 1,
+ });
+ }
+ );
+}
+
+has tempdir => (
+ is => 'ro',
+ writer => '_set_tempdir',
+ init_arg => undef,
+);
+
+sub clear_log_events {
+ my ($self) = @_;
+ $self->chrome->logger->clear_events;
+}
+
+sub log_events {
+ my ($self) = @_;
+ $self->chrome->logger->events;
+}
+
+sub log_messages {
+ my ($self) = @_;
+ [ map {; $_->{message} } @{ $self->chrome->logger->events } ];
+}
+
+sub slurp_file {
+ my ($self, $filename) = @_;
+
+ return scalar do {
+ local $/;
+ open my $fh, '<', $self->tempdir->file($filename);
+ <$fh>;
+ };
+}
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Dist::Zilla::Tester - a testing-enabling stand-in for Dist::Zilla
+
+=head1 VERSION
+
+version 2.100960
+
+=head1 AUTHOR
+
+ Ricardo SIGNES <rjbs@cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by Ricardo SIGNES.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+
@@ -1,7 +1,9 @@
use strict;
use warnings;
package Dist::Zilla::Tutorial;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Tutorial::VERSION = '2.100960';
+}
# ABSTRACT: how to use this "Dist::Zilla" thing
use Carp ();
Carp::confess "you're not meant to use the tutorial, just read it!";
@@ -16,7 +18,7 @@ Dist::Zilla::Tutorial - how to use this "Dist::Zilla" thing
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 SYNOPSIS
@@ -1,5 +1,7 @@
package Dist::Zilla::Types;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Types::VERSION = '2.100960';
+}
# ABSTRACT: dzil-specific type library
use MooseX::Types -declare => [qw(DistName License)];
@@ -24,7 +26,7 @@ Dist::Zilla::Types - dzil-specific type library
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 AUTHOR
@@ -1,5 +1,7 @@
package Dist::Zilla::Util::MVPAssembler;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Util::MVPAssembler::VERSION = '2.100960';
+}
use Moose;
extends 'Config::MVP::Assembler';
with 'Config::MVP::Assembler::WithBundles';
@@ -29,7 +31,7 @@ Dist::Zilla::Util::MVPAssembler - Dist::Zilla-specific subclass of Config::MVP::
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 AUTHOR
@@ -1,27 +1,20 @@
use strict;
use warnings;
package Dist::Zilla::Util;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Util::VERSION = '2.100960';
+}
# ABSTRACT: random snippets of code that Dist::Zilla wants
-use String::Flogger;
-use String::RewritePrefix;
-
-{
- package
- Dist::Zilla::Util::Nonpod;
-our $VERSION = '1.100160';
- use base 'Pod::Eventual';
- sub _new { bless { nonpod => '' } => shift; }
- sub handle_nonpod { $_[0]->{nonpod} .= $_[1]->{content} }
- sub handle_event {}
- sub _nonpod { $_[0]->{nonpod} }
-}
+use String::RewritePrefix 0.002; # better string context behavior
{
package
Dist::Zilla::Util::PEA;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::Util::PEA::VERSION = '2.100960';
+}
+ use Pod::Eventual 0.091480; # better nonpod/blank events
use base 'Pod::Eventual';
sub _new { bless {} => shift; }
sub handle_nonpod {
@@ -80,12 +73,6 @@ sub expand_config_package_name {
return $str;
}
-sub _log {
- my $input = $_[1];
- my $output = String::Flogger->flog($input);
- print "$output\n";
-}
-
1;
__END__
@@ -97,7 +84,7 @@ Dist::Zilla::Util - random snippets of code that Dist::Zilla wants
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 METHODS
@@ -1,27 +1,41 @@
package Dist::Zilla;
-our $VERSION = '1.100160';
+BEGIN {
+ $Dist::Zilla::VERSION = '2.100960';
+}
# ABSTRACT: distribution builder; installer not included!
-use Moose;
-use Moose::Autobox;
+use Moose 0.92; # role composition fixes
+with 'Dist::Zilla::Role::ConfigDumper';
+
+use Moose::Autobox 0.09; # ->flatten
use Dist::Zilla::Types qw(DistName License);
+use MooseX::Types::Moose qw(Bool HashRef);
use MooseX::Types::Path::Class qw(Dir File);
use Moose::Util::TypeConstraints;
+use Archive::Tar;
use File::Find::Rule;
+use File::pushd ();
use Hash::Merge::Simple ();
+use List::MoreUtils qw(uniq);
+use List::Util qw(first);
+use Log::Dispatchouli 1.100712; # proxy_loggers, quiet_fatal
+use Params::Util qw(_HASHLIKE);
use Path::Class ();
use Software::License;
use String::RewritePrefix;
+use Dist::Zilla::Prereqs;
use Dist::Zilla::File::OnDisk;
use Dist::Zilla::Role::Plugin;
+use Dist::Zilla::Util;
use namespace::autoclean;
-has 'dzil_app' => (
+has chrome => (
is => 'rw',
- isa => 'Dist::Zilla::App',
+ isa => 'Object', # will be does => 'Dist::Zilla::Role::Chrome' when it exists
+ required => 1,
);
@@ -56,12 +70,12 @@ sub _build_version {
for my $plugin ($self->plugins_with(-VersionProvider)->flatten) {
next unless defined(my $this_version = $plugin->provide_version);
- confess('attempted to set version twice') if defined $version;
+ $self->log_fatal('attempted to set version twice') if defined $version;
$version = $this_version;
}
- confess('no version was ever set') unless defined $version;
+ $self->log_fatal('no version was ever set') unless defined $version;
$self->log("warning: version number does not look like a number")
unless $version =~ m{\A\d+(?:\.\d+)\z};
@@ -82,7 +96,6 @@ has abstract => (
die "no abstract given and no main_module found; make sure your main module is in ./lib\n";
}
- require Dist::Zilla::Util;
my $filename = $self->main_module->name;
$self->log("extracting distribution abstract from $filename");
my $abstract = Dist::Zilla::Util->abstract_from_file($filename);
@@ -119,23 +132,22 @@ has main_module => (
my $guessing = q{};
if ( $self->has_main_module_override ) {
-
- $file = $self->files->grep(sub{ $_->name eq $self->main_module_override })->head;
-
+ $file = first { $_->name eq $self->main_module_override }
+ $self->files->flatten;
} else {
$guessing = 'guessing '; # We're having to guess
(my $guess = $self->name) =~ s{-}{/}g;
$guess = "lib/$guess.pm";
- $file = $self->files->grep(sub{ $_->name eq $guess })->head
+ $file = (first { $_->name eq $guess } $self->files->flatten)
|| $self->files
->grep(sub { $_->name =~ m{\.pm\z} and $_->name =~ m{\Alib/} })
->sort(sub { length $_[0]->name <=> length $_[1]->name })
->head;
}
- die "Unable to find main_module in dist\n" unless $file;
+ $self->log_fatal("Unable to find main_module in dist") unless $file;
$self->log("${guessing}dist's main_module is " . $file->name);
@@ -144,7 +156,6 @@ has main_module => (
);
-
has copyright_holder => (
is => 'ro',
isa => 'Str',
@@ -199,7 +210,7 @@ sub _initialize_license {
$self->main_module->content
);
- Carp::confess("couldn't make a good guess at license") if @guess != 1;
+ $self->log_fatal("couldn't make a good guess at license") if @guess != 1;
my $filename = $self->main_module->name;
$license_class = $guess[0];
@@ -214,7 +225,8 @@ sub _initialize_license {
});
}
- confess "$value is not a valid license" if ! License->check($license);
+ $self->log_fatal("$value is not a valid license")
+ if ! License->check($license);
$self->_set_license($license);
}
@@ -246,10 +258,18 @@ has root => (
);
+has is_trial => (
+ is => 'rw', # XXX: make SetOnce -- rjbs, 2010-03-23
+ isa => Bool,
+ default => sub { $ENV{TRIAL} ? 1 : 0 }
+);
+
+
has plugins => (
is => 'ro',
isa => 'ArrayRef[Dist::Zilla::Role::Plugin]',
- default => sub { [ ] },
+ init_arg => undef,
+ default => sub { [ ] },
);
@@ -265,57 +285,61 @@ has distmeta => (
isa => 'HashRef',
init_arg => undef,
lazy => 1,
- default => sub {
- my ($self) = @_;
-
- my $meta = {
- 'meta-spec' => {
- version => 1.4,
- url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
- },
- name => $self->name,
- version => $self->version,
- abstract => $self->abstract,
- author => $self->authors,
- license => $self->license->meta_yml_name,
- requires => $self->prereq,
- generated_by => (ref $self) . ' version ' . $self->VERSION,
- };
-
- $meta = Hash::Merge::Simple::merge($meta, $_->metadata)
- for $self->plugins_with(-MetaProvider)->flatten;
-
- $meta;
- } # end default for distmeta
+ builder => '_build_distmeta',
);
-
-sub prereq {
+sub _build_distmeta {
my ($self) = @_;
- # XXX: This needs to always include the highest version. -- rjbs, 2008-06-01
- my $prereq = {};
- $prereq = $prereq->merge( $_->prereq )
- for $self->plugins_with(-FixedPrereqs)->flatten;
-
- return $prereq;
+ my $meta = {
+ 'meta-spec' => {
+ version => 1.4,
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ },
+ name => $self->name,
+ version => $self->version,
+ abstract => $self->abstract,
+ author => $self->authors,
+ license => $self->license->meta_yml_name,
+ generated_by => (ref $self)
+ . ' version '
+ . (defined $self->VERSION ? $self->VERSION : '(undef)')
+ };
+
+ $meta = Hash::Merge::Simple::merge($meta, $_->metadata)
+ for $self->plugins_with(-MetaProvider)->flatten;
+
+ return $meta;
}
+has prereq => (
+ is => 'ro',
+ isa => 'Dist::Zilla::Prereqs',
+ init_arg => undef,
+ default => sub { Dist::Zilla::Prereqs->new },
+ handles => [ qw(register_prereqs) ],
+);
+
+
sub from_config {
my ($class, $arg) = @_;
$arg ||= {};
my $root = Path::Class::dir($arg->{dist_root} || '.');
- my ($seq) = $class->_load_config(
- $arg->{config_class},
- $root,
- );
+ my ($seq) = $class->_load_config({
+ root => $root,
+ logger => $arg->{chrome}->logger,
+ config_class => $arg->{config_class},
+ });
my $core_config = $seq->section_named('_')->payload;
- my $self = $class->new($core_config);
+ my $self = $class->new({
+ %$core_config,
+ chrome => $arg->{chrome},
+ });
for my $section ($seq->sections) {
next if $section->name eq '_';
@@ -326,35 +350,108 @@ sub from_config {
$section->payload,
);
- $self->log("initializing plugin $name ($plugin_class)");
-
- confess "arguments attempted to override plugin name"
+ $self->log_fatal("$name arguments attempted to override plugin name")
if defined $arg->{plugin_name};
- confess "arguments attempted to override plugin name"
+ $self->log_fatal("$name arguments attempted to override plugin name")
if defined $arg->{zilla};
- $self->plugins->push(
- $plugin_class->new( $arg->merge({
+ my $plugin = $plugin_class->new(
+ $arg->merge({
plugin_name => $name,
zilla => $self,
- }) )
+ }),
);
+
+ my $version = $plugin->VERSION || 0;
+
+ $plugin->log_debug([ 'online, %s v%s', $plugin->meta->name, $version ]);
+
+ $self->plugins->push($plugin);
}
+ $self->_setup_default_plugins;
+
return $self;
}
+sub _setup_default_plugins {
+ my ($self) = @_;
+
+ unless ($self->plugin_named(':InstallModules')) {
+ require Dist::Zilla::Plugin::FinderCode;
+ my $plugin = Dist::Zilla::Plugin::FinderCode->new({
+ plugin_name => ':InstallModules',
+ zilla => $self,
+ style => 'grep',
+ code => sub { local $_ = $_->name; m{\Alib/} and m{\.(pm|pod)$} },
+ });
+
+ $self->plugins->push($plugin);
+ }
+
+ unless ($self->plugin_named(':TestFiles')) {
+ require Dist::Zilla::Plugin::FinderCode;
+ my $plugin = Dist::Zilla::Plugin::FinderCode->new({
+ plugin_name => ':TestFiles',
+ zilla => $self,
+ style => 'grep',
+ code => sub { local $_ = $_->name; m{\At/} },
+ });
+
+ $self->plugins->push($plugin);
+ }
+
+ unless ($self->plugin_named(':ExecFiles')) {
+ require Dist::Zilla::Plugin::FinderCode;
+ my $plugin = Dist::Zilla::Plugin::FinderCode->new({
+ plugin_name => ':ExecFiles',
+ zilla => $self,
+ style => 'list',
+ code => sub {
+ my $plugins = $_[0]->zilla->plugins_with(-ExecFiles);
+ my @files = map {; @{ $_->find_files } } @$plugins;
+
+ return \@files;
+ },
+ });
+
+ $self->plugins->push($plugin);
+ }
+
+ unless ($self->plugin_named(':ShareFiles')) {
+ require Dist::Zilla::Plugin::FinderCode;
+ my $plugin = Dist::Zilla::Plugin::FinderCode->new({
+ plugin_name => ':ShareFiles',
+ zilla => $self,
+ style => 'list',
+ code => sub {
+ return [] unless my $dir = $self->zilla->_share_dir;
+ return $self->zilla->files->grep(sub {
+ local $_ = $_->name; m{\A\Q$dir\E/}
+ });
+ },
+ });
+
+ $self->plugins->push($plugin);
+ }
+}
+
sub _load_config {
- my ($self, $config_class, $root) = @_;
+ my ($self, $arg) = @_;
+ $arg ||= {};
- $config_class ||= 'Dist::Zilla::Config::Finder';
+ my $config_class = $arg->{config_class} ||= 'Dist::Zilla::Config::Finder';
unless (eval "require $config_class; 1") {
die "couldn't load $config_class: $@"; ## no critic Carp
}
- $self->log("reading configuration using $config_class");
+ $arg->{logger}->log_debug(
+ { prefix => '[DZ] ' },
+ "reading configuration using $config_class"
+ );
+ my $root = $arg->{root};
my ($sequence) = $config_class->new->read_config({
root => $root,
basename => 'dist',
@@ -368,6 +465,15 @@ sub _load_config {
}
+sub plugin_named {
+ my ($self, $name) = @_;
+ my $plugin = first { $_->plugin_name eq $name } $self->plugins->flatten;
+
+ return $plugin if $plugin;
+ return;
+}
+
+
sub plugins_with {
my ($self, $role) = @_;
@@ -381,28 +487,56 @@ sub plugins_with {
sub find_files {
my ($self, $finder_name) = @_;
- my $plugin = $self->plugins_with(-FileFinder)
- ->grep(sub { $_->plugin_name eq $finder_name })->head;
+ $self->log_fatal("no plugin named $finder_name found")
+ unless my $plugin = $self->plugin_named($finder_name);
- confess("no FileFinder named $finder_name found") unless $plugin;
+ $self->log_fatal("plugin $finder_name is not a FileFinder")
+ unless $plugin->does('Dist::Zilla::Role::FileFinder');
$plugin->find_files;
}
+sub _share_dir {
+ my ($self) = @_;
+
+ my @share_dirs =
+ uniq $self->plugins_with(-ShareDir)->map(sub { $_->dir })->flatten;
+
+ $self->log_fatal("can't install more than one ShareDir") if @share_dirs > 1;
+
+ return unless defined(my $share_dir = $share_dirs[0]);
+
+ return unless grep { $_->name =~ m{\A\Q$share_dir\E/} }
+ $self->files->flatten;
+
+ return $share_dirs[0];
+}
+
+
+sub build { $_[0]->build_in }
sub build_in {
my ($self, $root) = @_;
- Carp::confess("attempted to build " . $self->name . " a second time")
+ $self->log_fatal("attempted to build " . $self->name . " a second time")
if $self->built_in;
$_->before_build for $self->plugins_with(-BeforeBuild)->flatten;
$self->log("beginning to build " . $self->name);
- $_->gather_files for $self->plugins_with(-FileGatherer)->flatten;
- $_->prune_files for $self->plugins_with(-FilePruner)->flatten;
- $_->munge_files for $self->plugins_with(-FileMunger)->flatten;
+ $_->gather_files for $self->plugins_with(-FileGatherer)->flatten;
+ $_->prune_files for $self->plugins_with(-FilePruner)->flatten;
+ $_->munge_files for $self->plugins_with(-FileMunger)->flatten;
+
+ $_->register_prereqs for $self->plugins_with(-PrereqSource)->flatten;
+
+ $self->prereq->finalize;
+
+ my $meta = $self->distmeta;
+ my $prereq = $self->prereq->as_distmeta;
+ $meta->{ $_ } = $prereq->{ $_ } for keys %$prereq;
+
$_->setup_installer for $self->plugins_with(-InstallTool)->flatten;
$self->_check_dupe_files;
@@ -422,11 +556,15 @@ sub build_in {
}
+sub ensure_built {
+ $_[0]->ensure_built_in;
+}
+
sub ensure_built_in {
my ($self, $root) = @_;
# $root ||= $self->name . q{-} . $self->version;
- return if $self->built_in and
+ return $self->built_in if $self->built_in and
(!$root or ($self->built_in eq $root));
Carp::croak("dist is already built, but not in $root") if $self->built_in;
@@ -435,24 +573,29 @@ sub ensure_built_in {
sub build_archive {
- my ($self, $root) = @_;
+ my ($self, $file) = @_;
- $self->ensure_built_in($root);
+ my $built_in = $self->ensure_built;
- require Archive::Tar;
my $archive = Archive::Tar->new;
- my $built_in = $self->built_in;
- my %seen_dir;
+ $_->before_archive for $self->plugins_with(-BeforeArchive)->flatten;
- for my $file ($self->files->flatten) {
- my $in = Path::Class::file($file->name)->dir;
+ my %seen_dir;
+ for my $distfile ($self->files->flatten) {
+ my $in = Path::Class::file($distfile->name)->dir;
$archive->add_files( $built_in->subdir($in) ) unless $seen_dir{ $in }++;
- $archive->add_files( $built_in->file( $file->name ) );
+ $archive->add_files( $built_in->file( $distfile->name ) );
}
## no critic
- my $file = Path::Class::file($self->name . '-' . $self->version . '.tar.gz');
+ $file ||= Path::Class::file(join(q{},
+ $self->name,
+ '-',
+ $self->version,
+ ($self->is_trial ? '-TRIAL' : ''),
+ '.tar.gz',
+ ));
$self->log("writing archive to $file");
$archive->write("$file", 9);
@@ -513,12 +656,10 @@ sub _write_out_file {
open my $out_fh, '>', "$to" or die "couldn't open $to to write: $!";
print { $out_fh } $file->content;
close $out_fh or die "error closing $to: $!";
+ chmod $file->mode, "$to" or die "couldn't chmod $to: $!";
}
-sub test { die '...' }
-
-
sub release {
my $self = shift;
@@ -528,29 +669,172 @@ sub release {
my $tgz = $self->build_archive;
# call all plugins implementing BeforeRelease role
- $_->before_release() for $self->plugins_with(-BeforeRelease)->flatten;
+ $_->before_release($tgz) for $self->plugins_with(-BeforeRelease)->flatten;
# do the actual release
$_->release($tgz) for @releasers;
# call all plugins implementing AfterRelease role
- $_->after_release() for $self->plugins_with(-AfterRelease)->flatten;
+ $_->after_release($tgz) for $self->plugins_with(-AfterRelease)->flatten;
+}
+
+
+sub clean {
+ my ($self) = @_;
+
+ require File::Path;
+ for my $x (grep { -e } '.build', glob($self->name . '-*')) {
+ $self->log("clean: removing $x");
+ File::Path::rmtree($x);
+ };
+
+ # removing leftovers
+ my @temps = File::Find::Rule->file->name( qr{~$} )->in('.');
+ $self->log("clean: removing $_"), unlink for @temps;
}
-# XXX: yeah, uh, do something more awesome -- rjbs, 2008-06-01
-sub log { ## no critic
- my ($self, $msg) = @_;
- require Dist::Zilla::Util;
- Dist::Zilla::Util->_log($msg);
+sub install {
+ my ($self, $arg) = @_;
+ $arg ||= {};
+
+ require File::Temp;
+
+ my $build_root = Path::Class::dir('.build');
+ $build_root->mkpath unless -d $build_root;
+
+ my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
+ $self->log("building distribution under $target for installation");
+ $self->ensure_built_in($target);
+
+ eval {
+ ## no critic Punctuation
+ my $wd = File::pushd::pushd($target);
+ my @cmd = $arg->{install_command}
+ ? $arg->{install_command}
+ : ($^X => '-MCPAN' => '-einstall "."');
+
+ system(@cmd) && $self->log_fatal([ "error running %s", \@cmd ]);
+ };
+
+ if ($@) {
+ $self->log($@);
+ $self->log("left failed dist in place at $target");
+ } else {
+ $self->log("all's well; removing $target");
+ $target->rmtree;
+ }
+
+ return;
}
+
+sub test {
+ my ($self) = @_;
+
+ Carp::croak("you can't test without any TestRunner plugins")
+ unless my @testers = $self->plugins_with(-TestRunner)->flatten;
+
+ require File::Temp;
+
+ my $build_root = Path::Class::dir('.build');
+ $build_root->mkpath unless -d $build_root;
+
+ my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
+ $self->log("building test distribution under $target");
+
+ local $ENV{AUTHOR_TESTING} = 1;
+ local $ENV{RELEASE_TESTING} = 1;
+
+ $self->ensure_built_in($target);
+
+ my $error = $self->run_tests_in($target);
+
+ $self->log("all's well; removing $target");
+ $target->rmtree;
+}
+
+
+sub run_tests_in {
+ my ($self, $target) = @_;
+
+ Carp::croak("you can't test without any TestRunner plugins")
+ unless my @testers = $self->plugins_with(-TestRunner)->flatten;
+
+ for my $tester (@testers) {
+ my $wd = File::pushd::pushd($target);
+ $tester->test( $target );
+ }
+}
+
+
+sub run_in_build {
+ my ($self, $cmd) = @_;
+
+ # The sort below is a cheap hack to get ModuleBuild ahead of
+ # ExtUtils::MakeMaker. -- rjbs, 2010-01-05
+ Carp::croak("you can't build without any BuildRunner plugins")
+ unless my @builders =
+ $self->plugins_with(-BuildRunner)->sort->reverse->flatten;
+
+ require "Config.pm"; # skip autoprereq
+ require File::Temp;
+
+ # dzil-build the dist
+ my $build_root = Path::Class::dir('.build');
+ $build_root->mkpath unless -d $build_root;
+
+ my $target = Path::Class::dir( File::Temp::tempdir(DIR => $build_root) );
+ my $abstarget = $target->absolute;
+ $self->log("building test distribution under $target");
+
+ $self->ensure_built_in($target);
+
+ # building the dist for real
+ my $ok = eval {
+ my $wd = File::pushd::pushd($target);
+ $builders[0]->build;
+ local $ENV{PERL5LIB} =
+ join $Config::Config{path_sep},
+ map { $abstarget->subdir('blib', $_) } qw{ arch lib };
+ system(@$cmd) and die "error while running: @$cmd";
+ 1;
+ };
+
+ if ($ok) {
+ $self->log("all's well; removing $target");
+ $target->rmtree;
+ } else {
+ my $error = $@ || '(unknown error)';
+ $self->log($error);
+ $self->log_fatal("left failed dist in place at $target");
+ }
+}
+
+
+has logger => (
+ is => 'ro',
+ isa => 'Log::Dispatchouli::Proxy', # could be duck typed, I guess
+ lazy => 1,
+ handles => [ qw(log log_debug log_fatal) ],
+ default => sub {
+ $_[0]->chrome->logger->proxy({ proxy_prefix => '[DZ] ' })
+ },
+);
+
sub BUILD {
my ($self, $arg) = @_;
$self->_initialize_license($arg->{license});
}
+around dump_config => sub {
+ my ($orig, $self) = @_;
+ my $config = $self->$orig;
+ $config->{is_trial} = $self->is_trial;
+ return $config;
+};
+
__PACKAGE__->meta->make_immutable;
1;
@@ -563,7 +847,7 @@ Dist::Zilla - distribution builder; installer not included!
=head1 VERSION
-version 1.100160
+version 2.100960
=head1 DESCRIPTION
@@ -579,12 +863,6 @@ For more information, see L<Dist::Zilla::Tutorial>.
=head1 ATTRIBUTES
-=head2 dzil_app
-
-This attribute (which is optional) will provide the Dist::Zilla::App object if
-the Dist::Zilla object is being used in the context of the F<dzil> command (or
-anything else using it through Dist::Zilla::App).
-
=head2 name
The name attribute (which is required) gives the name of the distribution to be
@@ -652,6 +930,10 @@ will, if left in this arrayref, be built into the dist.
This is the root directory of the dist, as a L<Path::Class::Dir>. It will
nearly always be the current working directory in which C<dzil> was run.
+=head2 is_trial
+
+This attribute tells us whether or not the dist will be a trial release.
+
=head2 plugins
This is an arrayref of plugins that have been plugged into this Dist::Zilla
@@ -673,6 +955,9 @@ This is a hashref of module prerequisites. This attribute is likely to get
greatly overhauled, or possibly replaced with a method based on other
(private?) attributes.
+I<Actually>, it is more likely that this attribute will contain an object in
+the future.
+
=head1 METHODS
=head2 from_config
@@ -687,6 +972,10 @@ Valid arguments are:
config_class - the class to use to read the config
default: Dist::Zilla::Config::Finder
+=head2 plugin_named
+
+ my $plugin = $zilla->plugin_named( $plugin_name );
+
=head2 plugins_with
my $roles = $zilla->plugins_with( -SomeRole );
@@ -712,6 +1001,12 @@ This method builds the distribution in the given directory. If no directory
name is given, it defaults to DistName-Version. If the distribution has
already been built, an exception will be thrown.
+=head2 build
+
+This method just calls C<build_in> with no arguments. It get you the default
+behavior without the weird-looking formulation of C<build_in> with no object
+for the preposition!
+
=head2 ensure_built_in
$zilla->ensure_built_in($root);
@@ -721,17 +1016,10 @@ C<$root> (or the default root, if no root is given), no exception is raised.
=head2 build_archive
- $dist->build_archive($root);
-
-This method will ensure that the dist has been built in the given root, and
-will then build a tarball of that directory in the current directory.
-
-=head2 test
-
- $zilla->test;
+ $dist->build_archive;
-This method builds a new copy of the distribution and tests it. If the tests
-appear to pass, it returns true. If something goes wrong, it returns false.
+This method will ensure that the dist has been built, and will then build a
+tarball of the build directory in the current directory.
=head2 release
@@ -741,13 +1029,34 @@ This method releases the distribution, probably by uploading it to the CPAN.
The actual effects of this method (as with most of the methods) is determined
by the loaded plugins.
+=head2 clean
+
+=head2 install
+
+=head2 test
+
+ $zilla->test;
+
+This method builds a new copy of the distribution and tests it.
+
+=head2 run_tests_in
+
+ my $error = $zilla->run_tests_in($directory);
+
+This method runs the tests in $directory (a Path::Class::Dir), which
+must contain an already-built copy of the distribution. It will throw an
+exception if there are test failures.
+
+It does I<not> set any of the C<*_TESTING> environment variables, nor
+does it clean up C<$directory> afterwards.
+
+=head2 run_in_build
+
=head2 log
$zilla->log($message);
-This method logs the given message. In the future it will be a more useful and
-expressive method. For now, it just prints the string after tacking on a
-newline.
+This method logs the given message.
=head1 SUPPORT
@@ -1,19 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-use File::Find::Rule;
-
-my @files = File::Find::Rule->name('*.pm')->in('lib');
-plan tests => @files - 1;
-
-for (@files) {
- next if /Tutorial.pm/;
- s/^lib.//;
- s/.pm$//;
- s{[\\/]}{::}g;
-
- ok(
- eval "require $_; 1",
- "loaded $_ with no problems",
- );
-}
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More;
+
+use File::Find::Rule;
+use Try::Tiny;
+
+my @files = File::Find::Rule->name('*.pm')->in('lib');
+plan tests => @files - 1;
+
+for (@files) {
+ next if /Tutorial.pm/;
+ s/^lib.//;
+ s/.pm$//;
+ s{[\\/]}{::}g;
+
+ require_ok($_);
+}
@@ -1,10 +0,0 @@
-use strict;
-use warnings;
-use Test::More 'no_plan';
-
-use Dist::Zilla;
-my $dzil = Dist::Zilla->from_config({
- dist_root => 't/eg/DZ1',
-});
-
-ok(1);
@@ -1,10 +0,0 @@
-use strict;
-use warnings;
-use Test::More 'no_plan';
-
-use Dist::Zilla;
-my $dzil = Dist::Zilla->from_config({
- dist_root => 't/eg/DZ1',
-});
-
-ok(1);
@@ -1,7 +0,0 @@
-name = DZ1
-version = 0.001
-author = E. Xavier Ample <example@example.org>
-license = Perl_5
-copyright_holder = E. Xavier Ample
-
-[@Classic]
@@ -1,11 +0,0 @@
-use strict;
-use warnings;
-package DZ1;
-our $VERSION = '1.100160';
-# ABSTRACT: this is a sample package for testing Dist::Zilla;
-
-sub main {
- return 1;
-}
-
-1;
@@ -1,8 +0,0 @@
-name => 'DZ2',
-version => '0.001',
-author => 'E. Xavier Ample <example@example.org>',
-license => 'Perl_5',
-copyright_holder => 'E. Xavier Ample',
-[
- '@Classic',
-]
@@ -1,11 +0,0 @@
-use strict;
-use warnings;
-package DZ1;
-our $VERSION = '1.100160';
-# ABSTRACT: this is a sample package for testing Dist::Zilla;
-
-sub main {
- return 1;
-}
-
-1;
@@ -1,24 +0,0 @@
-package Dist::Zilla::Plugin::CreditTaker;
-our $VERSION = '1.100160';
-# ABSTRACT: add 'built by D::Z' to all your modules
-use Moose;
-with 'Dist::Zilla::Role::FileMunger';
-
-sub munge_file {
- my ($self, $file) = @_;
-
- return unless $file->name =~ /\.pm/;
-
- my $content = $file->content;
- return if $content =~ /\A# built by Dist::Zilla/;
-
- my $credit = "# built by Dist::Zilla " . Dist::Zilla->VERSION . "\n";
- $content =~ s/\A/$credit/;
-
- $file->content($content);
- return;
-}
-
-__PACKAGE__->meta->make_immutable;
-no Moose;
-1;
@@ -1,19 +0,0 @@
-package Dist::Zilla::Plugin::FailTest;
-our $VERSION = '1.100160';
-# ABSTRACT: fake plugin to test dzil testing
-
-use Moose;
-
-with 'Dist::Zilla::Role::TestRunner';
-
-sub test {
- my $self = shift;
- die '[FailTest] Emitted an Fail';
- return;
-}
-
-no Moose;
-__PACKAGE__->meta->make_immutable;
-1;
-__END__
-
@@ -0,0 +1,80 @@
+use strict;
+use warnings;
+package Test::DZil;
+
+use Dist::Zilla::Tester;
+use Params::Util qw(_HASH0);
+
+use Sub::Exporter -setup => {
+ exports => [
+ dist_ini => \'_dist_ini',
+ simple_ini => \'_simple_ini',
+ ],
+ groups => [ default => [ qw(dist_ini simple_ini) ] ],
+};
+
+sub _build_ini_builder {
+ my ($starting_core) = @_;
+ $starting_core ||= {};
+
+ sub {
+ my (@arg) = @_;
+ my $new_core = _HASH0($arg[0]) ? shift(@arg) : {};
+
+ my $core_config = { %$starting_core, %$new_core };
+
+ my $config = '';
+
+ for my $key (keys %$core_config) {
+ my @values = ref $core_config->{ $key }
+ ? @{ $core_config->{ $key } }
+ : $core_config->{ $key };
+
+ $config .= "$key = $_\n" for grep {defined} @values;
+ }
+
+ $config .= "\n" if length $config;
+
+ for my $line (@arg) {
+ my @plugin = ref $line ? @$line : ($line, {});
+ my $moniker = shift @plugin;
+ my $name = _HASH0($plugin[0]) ? undef : shift @plugin;
+ my $payload = shift(@plugin) || {};
+
+ die "TOO MANY ARGS TO PLUGIN GAHLGHALAGH" if @plugin;
+
+ $config .= '[' . $moniker;
+ $config .= ' / ' . $name if defined $name;
+ $config .= "]\n";
+
+ for my $key (keys %$payload) {
+ my @values = ref $payload->{ $key }
+ ? @{ $payload->{ $key } }
+ : $payload->{ $key };
+
+ $config .= "$key = $_\n" for @values;
+ }
+
+ $config .= "\n";
+ }
+
+ return $config;
+ }
+}
+
+sub _dist_ini {
+ _build_ini_builder;
+}
+
+sub _simple_ini {
+ _build_ini_builder({
+ name => 'DZT-Sample',
+ abstract => 'Sample DZ Dist',
+ version => '0.001',
+ author => 'E. Xavier Ample <example@example.org>',
+ license => 'Perl_5',
+ copyright_holder => 'E. Xavier Ample',
+ });
+}
+
+1;
@@ -0,0 +1,46 @@
+#!perl
+use strict;
+use warnings;
+
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+use YAML::Tiny;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/AutoPrereq' },
+ { },
+);
+
+$tzil->build;
+
+# check found prereqs
+my $meta = YAML::Tiny->new->read($tzil->tempdir->file('build/META.yml'))->[0];
+
+my %wanted = (
+ # DZPA::Main should not be extracted
+ 'DZPA::Base::Moose1' => 0,
+ 'DZPA::Base::Moose2' => 0,
+ 'DZPA::Base::base1' => 0,
+ 'DZPA::Base::base2' => 0,
+ 'DZPA::Base::base3' => 0,
+ 'DZPA::Base::parent1' => 0,
+ 'DZPA::Base::parent2' => 0,
+ 'DZPA::Base::parent3' => 0,
+ 'DZPA::IgnoreAPI' => 0,
+ 'DZPA::IndentedRequire' => '3.45',
+ 'DZPA::IndentedUse' => '0.13',
+ 'DZPA::MinVerComment' => '0.50',
+ 'DZPA::ModRequire' => 0,
+ 'DZPA::NotInDist' => 0,
+ 'DZPA::Role' => 0,
+ 'DZPA::ScriptUse' => 0,
+ 'parent' => 0,
+ 'perl' => 5.008,
+);
+
+is_deeply( $meta->{requires}, \%wanted, 'all requires found, but no more' );
+
+done_testing;
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+use YAML::Tiny;
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ { version => undef },
+ 'GatherDir',
+ [ AutoVersion => { major => 6, format => '{{$major}}.{{$^T}}' } ],
+ ),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my $want_version = "6." . $^T;
+
+ is($tzil->version, $want_version, "dist version is set (in DZ obj)");
+}
+
+done_testing;
@@ -0,0 +1,83 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+use Try::Tiny;
+
+{
+ try {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ qw(GatherDir ConfirmRelease FakeRelease)
+ ),
+ },
+ },
+ );
+
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ $tzil->release;
+ } catch {
+ like(
+ $_,
+ qr/aborting release/i,
+ "ConfirmRelease aborts by default",
+ );
+ }
+
+}
+
+for my $no (qw(n no)) {
+ try {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ qw(GatherDir ConfirmRelease FakeRelease)
+ ),
+ },
+ },
+ );
+
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ local $ENV{DZIL_CONFIRMRELEASE_DEFAULT} = $no;
+ $tzil->release;
+ } catch {
+ like(
+ $_,
+ qr/aborting release/i,
+ "ConfirmRelease aborts when told $no",
+ );
+ }
+
+}
+
+for my $yes (qw(y yes)) {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ qw(GatherDir ConfirmRelease FakeRelease)
+ ),
+ },
+ },
+ );
+
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ local $ENV{DZIL_CONFIRMRELEASE_DEFAULT} = $yes;
+ $tzil->release;
+
+ ok(
+ grep({ /Fake release happening/i } @{ $tzil->log_messages }),
+ "DZIL_CONFIRMRELEASE_DEFAULT=$yes allows release"
+ );
+}
+
+done_testing;
@@ -0,0 +1,70 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+use JSON 2;
+use YAML::Tiny;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ 'GatherDir',
+ [ MetaResources => HomePage => { homepage => 'http://bana.na/phone' } ],
+ [ MetaResources => License => { license => 'http://b.sd/license' } ],
+ [ Prereq => { 'Foo::Bar' => '1.234' } ],
+ [ Prereq => RuntimeRecommends => { 'Foo::Bar::Opt' => '1.234' } ],
+ [ Prereq => BuildRequires => { 'Test::Foo' => '2.34' } ],
+ [ Prereq => ConfigureRequires => { 'Build::Foo' => '0.12' } ],
+ 'MetaJSON',
+ 'MetaYAML',
+ 'MetaConfig',
+ ),
+ },
+ },
+);
+
+$tzil->build;
+
+my @files = map {; $_->name } @{ $tzil->files };
+
+my %meta;
+
+my $json = $tzil->slurp_file('build/META.json');
+$meta{json} = JSON->new->decode($json);
+
+my $yaml = $tzil->slurp_file('build/META.yml');
+$meta{yaml} = YAML::Tiny->new->read_string($yaml)->[0];
+
+is_deeply($meta{json}, $meta{yaml}, "META.json is_deeply META.yml");
+
+for my $type (qw(json yaml)) {
+ my $meta = $meta{$type};
+
+ my %want = (
+ name => 'DZT-Sample',
+ abstract => 'Sample DZ Dist',
+ author => [ 'E. Xavier Ample <example@example.org>' ],
+ requires => { 'Foo::Bar' => '1.234' },
+ recommends => { 'Foo::Bar::Opt' => '1.234' },
+ build_requires => { 'Test::Foo' => '2.34' },
+ configure_requires => { 'Build::Foo' => '0.12' },
+ license => 'perl',
+ resources => {
+ homepage => 'http://bana.na/phone',
+ license => 'http://b.sd/license',
+ },
+ version => '0.001',
+ );
+
+ for my $key (sort keys %want) {
+ is_deeply($meta->{ $key }, $want{ $key }, "$key is what we want in $type");
+ }
+}
+
+done_testing;
@@ -0,0 +1,63 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $generic_test = <<'END_TEST';
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More 0.88;
+
+ok(0, "stop building me!");
+
+done_testing;
+END_TEST
+
+my @xt_types = qw(smoke author release);
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini('GatherDir', 'ExtraTests'),
+ (map {; "source/xt/$_/huffer.t" => $generic_test }
+ @xt_types, qw(blort))
+ },
+ },
+);
+
+$tzil->build;
+
+my @files = map {; $_->name } @{ $tzil->files };
+
+is_deeply(
+ [ sort @files ],
+ [ sort qw(
+ dist.ini lib/DZT/Sample.pm t/basic.t
+ t/smoke-huffer.t
+ t/author-huffer.t
+ t/release-huffer.t
+ xt/blort/huffer.t
+ ) ],
+ "filenames rewritten by ExtraTests",
+);
+
+for my $type (@xt_types) {
+ my $test_program = $tzil->slurp_file("build/t/$type-huffer.t");
+ my $env = uc sprintf "%s_TESTING", $type eq 'smoke' ? 'automated' : $type;
+
+ like(
+ $test_program,
+ qr/\$ENV\{$env\}/,
+ "we mention $env in the rewritten $type test",
+ );
+}
+
+done_testing;
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+use Try::Tiny;
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(qw(GatherDir FakeRelease)),
+ },
+ },
+ );
+
+ $tzil->release;
+
+ ok(
+ grep({ /fake release happen/i } @{ $tzil->log_messages }),
+ "we log a fake release when we fake release",
+ );
+}
+
+{
+ try {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(qw(GatherDir FakeRelease)),
+ },
+ },
+ );
+
+ local $ENV{DZIL_FAKERELEASE_FAIL} = 1;
+ $tzil->release;
+ } catch {
+ like(
+ $_,
+ qr/DZIL_FAKERELEASE_FAIL set, aborting/i,
+ "we can make FakeRelease fail when we want!"
+ );
+ }
+}
+
+done_testing;
@@ -0,0 +1,37 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use Dist::Zilla::PluginBundle::Classic;
+use Dist::Zilla::PluginBundle::Filter;
+
+my @classic = Dist::Zilla::PluginBundle::Classic->bundle_config({
+ name => '@Classic',
+ package => 'Dist::Zilla::PluginBundle::Classic',
+ payload => { },
+});
+
+my @filtered = Dist::Zilla::PluginBundle::Filter->bundle_config({
+ name => '@CF',
+ package => 'Dist::Zilla::PluginBundle::Filter',
+ payload => {
+ bundle => '@Classic',
+ remove => [ qw(ManifestSkip PkgVersion) ],
+ },
+});
+
+is(@filtered, @classic - 2, "filtering 2 plugins gets us 2 fewer plugins!");
+
+my $before_count =
+ grep { $_->[1] =~ /\ADist::Zilla::Plugin::(?:ManifestSkip|PkgVersion)\z/ }
+ @classic;
+
+is($before_count, 2, "we started with the 2 we wanted to remove");
+
+my $after_count =
+ grep { $_->[1] =~ /\ADist::Zilla::Plugin::(?:ManifestSkip|PkgVersion)\z/ }
+ @filtered;
+
+is($after_count, 0, "...then we removed them");
+
+done_testing;
@@ -0,0 +1,56 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ [ GatherDir => ],
+ [ GatherDir => BonusFiles => {
+ root => '../corpus/extra',
+ prefix => 'bonus',
+ } ],
+ [ GatherDir => DottyFiles => {
+ root => '../corpus/extra',
+ prefix => 'dotty',
+ include_dotfiles => 1,
+ } ],
+ 'Manifest',
+ ),
+ 'source/.profile' => "Bogus dotfile.\n",
+ 'corpus/extra/.dotfile' => "Bogus dotfile.\n",
+ },
+ also_copy => { 'corpus/extra' => 'corpus/extra' },
+ },
+);
+
+$tzil->build;
+
+my @files = map {; $_->name } @{ $tzil->files };
+
+is_deeply(
+ [ sort @files ],
+ [ sort qw(
+ bonus/subdir/index.html bonus/vader.txt
+ dotty/subdir/index.html dotty/vader.txt dotty/.dotfile
+ dist.ini lib/DZT/Sample.pm t/basic.t
+ MANIFEST
+ ) ],
+ "GatherDir gathers all files in the source dir",
+);
+
+my $manifest = $tzil->slurp_file('build/MANIFEST');
+my %in_manifest = map {; chomp; $_ => 1 } grep {length} split /\n/, $manifest;
+
+my $count = grep { $in_manifest{$_} } @files;
+ok($count == @files, "all files found were in manifest");
+ok(keys(%in_manifest) == @files, "all files in manifest were on disk");
+
+done_testing;
+
@@ -0,0 +1,157 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+sub test_this {
+ my ($plugins, $add_files, $assertion) = @_;
+
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ 'GatherDir',
+ @$plugins,
+ [ Prereq => { 'Foo::Bar' => '1.20' } ],
+ [ Prereq => BuildRequires => { 'Builder::Bob' => '9.901' } ],
+ [ Prereq => TestRequires => { 'Test::Deet' => '7' } ],
+ ),
+ %$add_files,
+ },
+ },
+ );
+
+ $tzil->build;
+
+ $assertion->($tzil);
+}
+
+# ShareDir
+
+test_this(
+ [ qw(MakeMaker) ],
+ { },
+ sub {
+ my $tzil = shift;
+ my $makefile = $tzil->slurp_file('build/Makefile.PL');
+ unlike($makefile, qr/install_share .share./, "not going to install share");
+ },
+);
+
+test_this(
+ [ qw(MakeMaker ShareDir) ],
+ { },
+ sub {
+ my $tzil = shift;
+ my $makefile = $tzil->slurp_file('build/Makefile.PL');
+ unlike($makefile, qr/install_share .share./, "not going to install share");
+ },
+);
+
+
+test_this(
+ [ qw(MakeMaker) ],
+ { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" },
+ sub {
+ my $tzil = shift;
+ my $makefile = $tzil->slurp_file('build/Makefile.PL');
+ unlike(
+ $makefile,
+ qr/install_share .share./,
+ "files in ./share, but no ShareDir, so we will not install_share"
+ );
+ },
+);
+
+test_this(
+ [ qw(MakeMaker ShareDir) ],
+ { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" },
+ sub {
+ my $tzil = shift;
+ my $makefile = $tzil->slurp_file('build/Makefile.PL');
+ like(
+ $makefile,
+ qr/install_share .share./,
+ "files in ./share, ShareDir, so we will install_share"
+ );
+ },
+);
+
+test_this(
+ [ qw(ModuleBuild ShareDir) ],
+ { 'source/share/stupid-share.txt' => "This is a sharedir file.\n" },
+ sub {
+ my $tzil = shift;
+ my $modulebuild = $tzil->plugin_named('ModuleBuild');
+ is(
+ $modulebuild->__module_build_args->{share_dir},
+ 'share',
+ "files in ./share, ShareDir, so we have a Build.PL share_dir"
+ );
+ },
+);
+
+# ExecDir
+
+test_this(
+ [ qw(MakeMaker) ],
+ { },
+ sub {
+ my $tzil = shift;
+ my $makemaker = $tzil->plugin_named('MakeMaker');
+
+ is_deeply(
+ $makemaker->__write_makefile_args->{EXE_FILES},
+ [],
+ "not going to install execs",
+ );
+ },
+);
+
+test_this(
+ [ qw(MakeMaker) ],
+ { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" },
+ sub {
+ my $tzil = shift;
+ my $makemaker = $tzil->plugin_named('MakeMaker');
+ is_deeply(
+ $makemaker->__write_makefile_args->{EXE_FILES},
+ [],
+ "files in ./bin, but no ExecDir, not going to install execs",
+ );
+ },
+);
+
+test_this(
+ [ qw(MakeMaker ExecDir) ],
+ { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" },
+ sub {
+ my $tzil = shift;
+ my $makemaker = $tzil->plugin_named('MakeMaker');
+ is_deeply(
+ $makemaker->__write_makefile_args->{EXE_FILES},
+ [ 'bin/be-stiff' ],
+ "files in ./bin, ExecDir, going to install execs",
+ );
+ },
+);
+
+test_this(
+ [ qw(ModuleBuild ExecDir) ],
+ { 'source/bin/be-stiff' => "#!perl\nuse D::Evo;\nuse B::Stuff;\n" },
+ sub {
+ my $tzil = shift;
+ my $modulebuild = $tzil->plugin_named('ModuleBuild');
+ is_deeply(
+ $modulebuild->__module_build_args->{script_files},
+ [ 'bin/be-stiff' ],
+ "files in ./bin, ExecDir, going to install execs in Build.PL",
+ );
+ },
+);
+
+done_testing;
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini('License'),
+ },
+ },
+);
+
+$tzil->build;
+
+my $contents = $tzil->slurp_file('build/LICENSE');
+
+like(
+ $contents,
+ qr{This software is copyright .c. [0-9]+ by E\. Xavier Ample}i,
+ "copyright appears in LICENSE file",
+);
+
+like(
+ $contents,
+ qr{same terms as (the )?perl.*itself}i,
+ "'same terms as perl'-ish text appears in LICENSE",
+);
+
+done_testing;
+
@@ -0,0 +1,58 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ 'GatherDir',
+ 'MakeMaker',
+ [ Prereq => { 'Foo::Bar' => '1.20' } ],
+ [ Prereq => BuildRequires => { 'Builder::Bob' => '9.901' } ],
+ [ Prereq => TestRequires => { 'Test::Deet' => '7' } ],
+ ),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my $makemaker = $tzil->plugin_named('MakeMaker');
+
+ my %want = (
+ DISTNAME => 'DZT-Sample',
+ NAME => 'DZT::Sample',
+ ABSTRACT => 'Sample DZ Dist',
+ VERSION => '0.001',
+ AUTHOR => 'E. Xavier Ample <example@example.org>',
+ LICENSE => 'perl',
+
+ PREREQ_PM => {
+ 'Foo::Bar' => '1.20'
+ },
+ BUILD_REQUIRES => {
+ 'Builder::Bob' => '9.901',
+ 'Test::Deet' => '7',
+ },
+ CONFIGURE_REQUIRES => {
+ 'ExtUtils::MakeMaker' => '6.31'
+ },
+ );
+
+ for my $key (sort keys %want) {
+ is_deeply(
+ $makemaker->__write_makefile_args->{ $key },
+ $want{ $key },
+ "correct value set for $key",
+ );
+ }
+}
+
+done_testing;
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ qw(GatherDir MetaTests PodSyntaxTests PodCoverageTests)
+ ),
+ },
+ },
+);
+
+$tzil->build;
+
+my $meta_test = $tzil->slurp_file('build/xt/release/distmeta.t');
+like($meta_test, qr{meta_yaml_ok}, "we have a distmeta file that tests it");
+
+my $pod_test = $tzil->slurp_file('build/xt/release/pod-syntax.t');
+like($pod_test, qr{all_pod_files_ok}, "we have a pod-syntax test");
+
+my $pod_c_test = $tzil->slurp_file('build/xt/release/pod-coverage.t');
+like($pod_c_test, qr{all_pod_coverage_ok}, "we have a pod-coverage test");
+
+done_testing;
@@ -0,0 +1,63 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ 'GatherDir',
+ 'ModuleBuild',
+ [ Prereq => { 'Foo::Bar' => '1.20' } ],
+ [ Prereq => BuildRequires => { 'Builder::Bob' => '9.901' } ],
+ [ Prereq => TestRequires => { 'Test::Deet' => '7' } ],
+ ),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my $modulebuild = $tzil->plugin_named('ModuleBuild');
+
+ my $have = $modulebuild->__module_build_args;
+
+ my %want = (
+ 'module_name' => 'DZT::Sample',
+ 'dist_name' => 'DZT-Sample',
+ 'dist_abstract' => 'Sample DZ Dist',
+ 'dist_version' => '0.001',
+ 'dist_author' => [
+ 'E. Xavier Ample <example@example.org>'
+ ],
+ 'license' => 'perl',
+
+ 'requires' => {
+ 'Foo::Bar' => '1.20'
+ },
+ build_requires => {
+ 'Builder::Bob' => '9.901',
+ 'Module::Build' => '0.3601',
+ 'Test::Deet' => '7',
+ },
+ 'configure_requires' => {
+ 'Module::Build' => '0.3601',
+ },
+ );
+
+ for my $key (sort keys %want) {
+ is_deeply(
+ $have->{ $key },
+ $want{ $key },
+ "correct value set for $key",
+ );
+ }
+}
+
+done_testing;
@@ -0,0 +1,103 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+use Try::Tiny;
+
+my $changes = <<'END_CHANGES';
+Revision history for {{$dist->next}}
+
+{{$NEXT}}
+ got included in an awesome test suite
+
+0.000 2009-01-02
+ finally left home, proving to mom I can make it!
+
+END_CHANGES
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/Changes' => $changes,
+ 'source/dist.ini' => simple_ini(qw(GatherDir NextRelease FakeRelease)),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ like(
+ $tzil->slurp_file('build/Changes'),
+ qr{0\.001},
+ "new version appears in build Changes file",
+ );
+
+ unlike(
+ $tzil->slurp_file('source/Changes'),
+ qr{0\.001},
+ "new version does not yet appear in source Changes file",
+ );
+
+ $tzil->release;
+
+ like(
+ $tzil->slurp_file('source/Changes'),
+ qr{0\.001},
+ "new version appears in source Changes file after release",
+ );
+
+ ok(
+ grep({ /fake release happen/i } @{ $tzil->log_messages }),
+ "we log a fake release when we fake release",
+ );
+}
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/Changes' => $changes,
+ 'source/dist.ini' => simple_ini(qw(GatherDir NextRelease FakeRelease)),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ like(
+ $tzil->slurp_file('build/Changes'),
+ qr{0\.001},
+ "new version appears in build Changes file",
+ );
+
+ unlike(
+ $tzil->slurp_file('source/Changes'),
+ qr{0\.001},
+ "new version does not yet appear in source Changes file",
+ );
+
+ try {
+ local $ENV{DZIL_FAKERELEASE_FAIL} = 1;
+ $tzil->release;
+ } catch {
+ like(
+ $_,
+ qr/DZIL_FAKERELEASE_FAIL set, aborting/i,
+ "we can make FakeRelease fail when we want!"
+ );
+ };
+
+ unlike(
+ $tzil->slurp_file('source/Changes'),
+ qr{0\.001},
+ "no new version in source Changes after failed release",
+ );
+}
+
+done_testing;
@@ -0,0 +1,71 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $with_version = '
+package DZT::WVer;
+our $VERSION = 1.234;
+1;
+';
+
+my $two_packages = '
+package DZT::TP1;
+
+package DZT::TP2;
+
+1;
+';
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/lib/DZT/TP1.pm' => $two_packages,
+ 'source/lib/DZT/WVer.pm' => $with_version,
+ 'source/dist.ini' => simple_ini('GatherDir', 'PkgVersion'),
+ },
+ },
+);
+
+$tzil->build;
+
+my $dzt_sample = $tzil->slurp_file('build/lib/DZT/Sample.pm');
+like(
+ $dzt_sample,
+ qr{^\s*\$\QDZT::Sample::VERSION = '0.001';\E$}m,
+ "added version to DZT::Sample",
+);
+
+my $dzt_tp1 = $tzil->slurp_file('build/lib/DZT/TP1.pm');
+like(
+ $dzt_tp1,
+ qr{^\s*\$\QDZT::TP1::VERSION = '0.001';\E$}m,
+ "added version to DZT::TP1",
+);
+
+like(
+ $dzt_tp1,
+ qr{^\s*\$\QDZT::TP2::VERSION = '0.001';\E$}m,
+ "added version to DZT::TP2",
+);
+
+my $dzt_wver = $tzil->slurp_file('build/lib/DZT/WVer.pm');
+unlike(
+ $dzt_wver,
+ qr{^\s*\$\QDZT::WVer::VERSION = '0.001';\E$}m,
+ "*not* added to DZT::WVer; we have one already",
+);
+
+ok(
+ grep({ m(skipping lib/DZT/WVer\.pm: assigns to \$VERSION) }
+ @{ $tzil->log_messages }),
+ "we report the reason for no updateing WVer",
+);
+
+done_testing;
+
@@ -0,0 +1,84 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $with_place_for_pod = '
+
+package DZT::WPFP;
+
+=head1 NAME
+
+DZT::WPFP - with place for pod!
+
+=cut
+
+sub foo { }
+
+1;
+';
+
+my $with_version = '
+
+package DZT::WVer;
+
+=head1 NAME
+
+DZT::WVer - version in pod!
+
+=head1 VERSION
+
+version 1.234
+
+=cut
+
+sub foo { }
+
+1;
+';
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/lib/DZT/WPFP.pm' => $with_place_for_pod,
+ 'source/lib/DZT/WVer.pm' => $with_version,
+ 'source/dist.ini' => simple_ini('GatherDir', 'PodVersion'),
+ },
+ },
+);
+
+$tzil->build;
+
+my $want = <<'END_POD';
+=head1 VERSION
+
+version 0.001
+
+=cut
+END_POD
+
+my $dzt_sample = $tzil->slurp_file('build/lib/DZT/Sample.pm');
+ok(
+ index($dzt_sample, $want) == -1,
+ "we didn't add version pod to Sample; it has no NAME",
+);
+
+my $dzt_wpfp = $tzil->slurp_file('build/lib/DZT/WPFP.pm');
+ok(
+ index($dzt_wpfp, $want) > 0,
+ "we did add version pod to WPFP",
+);
+
+my $dzt_wver = $tzil->slurp_file('build/lib/DZT/WVer.pm');
+ok(
+ index($dzt_wver, $want) == -1,
+ "we didn't add version pod to WVer; it has one already",
+);
+
+done_testing;
+
@@ -0,0 +1,114 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Test::DZil;
+
+for my $skip_skip (0, 1) {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ [ GatherDir => ],
+ [ GatherDir => BonusFiles => {
+ root => '../corpus/extra',
+ prefix => 'bonus',
+ } ],
+ 'ManifestSkip',
+ ),
+ 'source/MANIFEST.SKIP' => join('', map {; "$_\n" } (
+ 'dist.ini',
+ '.*\.txt',
+ ($skip_skip ? 'MANIFEST.SKIP' : ()),
+ )),
+ },
+ also_copy => { 'corpus/extra' => 'corpus/extra' },
+ },
+ );
+
+ $tzil->build;
+
+ my @files = map {; $_->name } @{ $tzil->files };
+
+ is_deeply(
+ [ sort @files ],
+ [ sort(qw(bonus/subdir/index.html lib/DZT/Sample.pm t/basic.t),
+ ($skip_skip ? () : 'MANIFEST.SKIP')),
+ ],
+ "ManifestSkip prunes files from MANIFEST.SKIP",
+ );
+}
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/Build' => "This file is cruft.\n",
+ 'source/dist.ini' => simple_ini('GatherDir'),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my @files = map {; $_->name } @{ $tzil->files };
+
+ is_deeply(
+ [ sort @files ],
+ [ sort qw(dist.ini lib/DZT/Sample.pm t/basic.t Build) ],
+ "./Build is included by default...",
+ );
+}
+
+{
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/Build' => "This file is cruft.\n",
+ 'source/dist.ini' => simple_ini('GatherDir', 'PruneCruft'),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my @files = map {; $_->name } @{ $tzil->files };
+
+ is_deeply(
+ [ sort @files ],
+ [ sort qw(dist.ini lib/DZT/Sample.pm t/basic.t) ],
+ "...but /Build is pruned by PruneCruft",
+ );
+}
+
+for my $arg (qw(filename filenames)) {
+ my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ 'GatherDir',
+ [ PruneFiles => { $arg => 'dist.ini' } ],
+ ),
+ },
+ },
+ );
+
+ $tzil->build;
+
+ my @files = map {; $_->name } @{ $tzil->files };
+
+ is_deeply(
+ [ sort @files ],
+ [ sort qw(lib/DZT/Sample.pm t/basic.t) ],
+ "we can prune a specific file by request (arg $arg)",
+ );
+}
+
+done_testing;
+
@@ -0,0 +1,43 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use autodie;
+use Test::DZil;
+
+my $tzil = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini('Readme'),
+ },
+ },
+);
+
+$tzil->build;
+
+my $contents = $tzil->slurp_file('build/README');
+
+like(
+ $contents,
+ qr{This software is copyright .c. [0-9]+ by E\. Xavier Ample}i,
+ "copyright appears in README file",
+);
+
+like(
+ $contents,
+ qr{same terms as (the )?perl.*itself}i,
+ "'same terms as perl'-ish text appears in README",
+);
+
+my $name = $tzil->name;
+like(
+ $contents,
+ qr{\Q$name\E},
+ "dist name appears in README",
+);
+
+done_testing;
+
@@ -0,0 +1,15 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+use Test::More;
+
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+all_pod_files_ok();
\ No newline at end of file
@@ -0,0 +1,44 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use lib 't/lib';
+
+use Dist::Zilla::App::Tester;
+use Test::DZil;
+
+## SIMPLE TEST WITH DZIL::APP TESTER
+
+my $result = test_dzil('corpus/DZ1', [ qw(build) ]);
+
+is($result->exit_code, 0, "dzil would have exited 0");
+
+ok(
+ (grep { $_ eq '[DZ] writing archive to DZ1-0.001.tar.gz' }
+ @{ $result->log_messages }),
+ "we logged the archive-creation",
+);
+
+## SIMPLE TEST WITH DZIL TESTER
+
+my $tester = Dist::Zilla::Tester->from_config(
+ { dist_root => 'corpus/DZT' },
+ {
+ add_files => { 'source/dist.ini' => simple_ini('@Classic') },
+ }
+);
+
+$tester->build;
+
+ok(
+ (grep { $_->{message} =~ m<^\[DZ\]\s> } @{ $tester->chrome->logger->events }),
+ "we have at least some expected log content",
+);
+
+use YAML::Tiny;
+my $yaml = YAML::Tiny->read($tester->built_in->file('META.yml'));
+my $meta = $yaml->[0];
+
+like($meta->{generated_by}, qr{Dist::Zilla}, "powered by... ROBOT DINOSAUR");
+
+done_testing;
@@ -0,0 +1,50 @@
+# METHODS OF Dist::Zilla - these are actually really important (and hard?)
+
+find_files
+build, build_in
+ensure_built_in
+build_archive
+test
+release
+install
+clean
+
+# COMMANDS IN Dist::Zilla::App - should stop being interesting as overhauled
+
+Dist::Zilla::App::Command
+Dist::Zilla::App::Command::build
+Dist::Zilla::App::Command::clean
+Dist::Zilla::App::Command::install
+Dist::Zilla::App::Command::new
+Dist::Zilla::App::Command::release
+Dist::Zilla::App::Command::run
+Dist::Zilla::App::Command::smoke
+Dist::Zilla::App::Command::test
+
+# CONFIG STUFF - don't bother until assembly overhaul happens
+
+Dist::Zilla::Config
+Dist::Zilla::Config::Finder
+Dist::Zilla::Config::Perl
+
+# FILE CLASSES - probably tested sufficiently by testing plugins
+
+Dist::Zilla::File::FromCode
+Dist::Zilla::File::InMemory
+Dist::Zilla::File::OnDisk
+
+# PLUGINS
+
+* Dist::Zilla::Plugin::BumpVersion - not worth testing, doomed to be replaced
+
+* Dist::Zilla::Plugin::InlineFiles - exercised by other plugins
+* Dist::Zilla::Plugin::UploadToCPAN - difficult to test
+
+# PREREQ HANDLING
+Dist::Zilla::Prereqs
+
+# MISC
+Dist::Zilla::Tester
+Dist::Zilla::Types
+Dist::Zilla::Util
+Dist::Zilla::Util::MVPAssembler
@@ -0,0 +1,24 @@
+
+# SIMPLIFY COMMAND CLASSES
+
+Most of the command plugins for `dzil` should be very, very small:
+
+ package Dist::Zilla::App::Command::foo;
+ sub execute {
+ $self->zilla->foo;
+ }
+
+This means moving a bunch of logic into Zilla.pm, which should be easy.
+
+More important will be moving around configuration.
+
+I really don't like putting CPAN/PAUSE credentials in the global !release
+config. It doesn't exactly make sense. It should be more related to
+UploadToCPAN.
+
+I don't have a plan yet.
+
+# COMMANDS TO FIX:
+
+* new
+
@@ -0,0 +1,10 @@
+
+# COMMAND PLUGIN PROTOCOL
+
+Right now, we just load all the available plugins via App::Cmd. This is
+probably going to be a pain, in the future. There should be a way to mitigate
+an overabundance of command plugins. One option is that only the "core" ones
+are loaded unless you have ~/.dzil/config.ini with:
+
+ [!newcommand]
+
@@ -0,0 +1,35 @@
+
+# CONFIG ARG PREFIX RESERVATIONS
+
+1. All config arg names that start with [a-z] are reserved for the plugin.
+
+2. All config arg names that start with - are reserved for the plugin.
+
+3. All config arg names that start with : are reserved for Dist::Zilla.
+
+4. All config arg names that start with = are prohibited and are used internall
+ for things like plugin_name (?)
+
+This will let us say:
+
+ [Plugin]
+ :version = 1.23
+
+...which will then assert: Plugin->VERSION(1.23)
+
+The first two rules are already more or less in place for things like the
+Prereq plugin. It might be cool to make it easy for plugin authors to get at
+the two sets of args (-x and x) in their BUILDARGS or something. Possibly a
+Plugin-role-provided method to partition the args.
+
+We should also try to set aside the :-args as early as possible, so they're
+never available during plugin init without really digging. This would be
+similar to the way in which -args are not provided to generators in
+Sub::Exporter.
+
+## TODO
+
+Think about applying the same rules to plugin names. For example, in the
+future virtual plugins could be created with names like :Blorgle that do...
+stuff.
+
@@ -0,0 +1,22 @@
+
+# DELAY CORE ATTRIBUTE INIT
+
+We might want something like $zilla->name to come from some plugin that
+converts from main_module, or yadda yadda. This will allow
+register-on-the-fly of plugins because we can construct the Zilla before we
+know all its required attribute values.
+
+We'll probably mark those values as LazyRequired and SetOnce.
+
+## ATTRIBUTES TO FIX, IN ORDER:
+
+* main_module, name -- interdependent
+
+* abstract
+
+* version - it's unique and should be simplified
+* copyright_{holder,year} - should come from a plugin somehow, too
+* license
+* authors
+
+* root?
@@ -0,0 +1,25 @@
+
+# EXTERNALIZE CORE ATTRIBUTES
+
+Right now you can't initialize a Zilla without a few attributes like name,
+author, etc. These should be autodetectable, meaning they should be able to
+wait until plugin initialization is complete -- or at least underway. (...but
+probably until it's complete. It should be possible, for example, to defer
+decision on name and version until FileGather-ing is done.)
+
+## STRATEGY?
+
+I think what I want is some simple attribute traits:
+
+ has name => (
+ ...
+ traits => [ qw(WORM Demanded) ],
+ );
+
+WORM is what it sounds like. Once set, the value cannot be changed. The
+writer throws if the predicate returns true.
+
+Demanded means that the accessor is fatal if the predicate is false.
+
+Together, it means you *must initialize* the value before reading it, and you
+*must not* try to change it once initialized.
@@ -0,0 +1,5 @@
+
+# TURN `DZIL NEW` INTO EVENTS
+
+I have no idea what these will be yet. That means the first course of business
+is making a list of use cases.
@@ -0,0 +1,9 @@
+
+# PREREQ COMMAND
+
+ dzil prereq
+
+should print the dist's computed prereqs, and nothing else, for consumption by
+(say) cpanm
+
+hanekomu wrote something like this; it should be refined and cored
@@ -0,0 +1,26 @@
+
+# REGISTER PLUGINS ON THE FLY
+
+Plugins should be registered with the Dist::Zilla object as soon as possible.
+
+Once the config section for the plugin is finalized, it should be registered.
+
+This means the MVP Assembler needs to have a reference to the zilla object. I
+don't think that's crazy. The whole _load_config method is a relic and should
+be streamlined. Almost all construction of Dist::Zilla objects will be through
+from_config, so it should really make sense. ->new is unlikely for any normal
+person to call.
+
+The zilla object should also have reference back to its assembler, at least as
+long as the assembler is assembling. This will allow something insane like
+this:
+
+ [ExtraExpander]
+ Glug:: = Glug::Dist::Zilla::Plugin::
+
+ExtraExpander will, upon plugin registration, find the Assembler and apply a
+trait with a method modifier to alter the String::RewritePrefix usage to add a
+new rewrite.
+
+Applying traits via plugins at registration time should be a very powerful, if
+dangerous, ability.
@@ -0,0 +1,16 @@
+
+# UPSTREAM TEST IMPROVEMENTS
+
+Dist-Zilla needs its own tests. It's produced a lot of spin-off libraries,
+though, and a few of them are nearly as poorly tested as Dist::Zilla itself.
+
+## HIT LIST
+
+Not all of these are known to be problems. They just need to be
+double-checked. Basically, it's all the code RJBS wrote while writing DZ.
+
+* Config::INI::MVP::Reader
+* Mixin::Linewise
+* CPAN::Uploader
+
+
@@ -0,0 +1,7 @@
+
+# NEXT VERSION FROM PREVIOUS VERSION
+
+Sort of like BumpVersion, but with pluggable version-finding and -bumping.
+
+Ævar wrote something like this, and it should be cored after being rewritten to
+use plugin-by-name finding and some other future dzilisms.
@@ -0,0 +1,5 @@
+
+# XS AUTHORING
+
+First order of business: ask the XS authors what would help beyond the
+now-released `dzil run`.